Files
Recordly/.github/workflows/release.yml
T

282 lines
7.5 KiB
YAML

name: Release Builds
on:
workflow_dispatch:
inputs:
source_ref:
description: Branch, tag, or commit to build from
required: true
default: main
type: string
tag_name:
description: Release tag to create or update
required: true
type: string
release_name:
description: Release title
required: true
type: string
release_notes:
description: Optional release notes
required: false
type: string
make_latest:
description: Mark this release as the latest release
required: true
default: true
type: boolean
permissions:
contents: write
jobs:
validate-release:
name: Validate release input
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.version.outputs.package_version }}
steps:
- name: Checkout source ref
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_ref }}
- name: Validate tag matches package version
id: version
shell: bash
run: |
set -euo pipefail
PACKAGE_VERSION=$(node -p "require('./package.json').version")
TAG_VERSION="${{ github.event.inputs.tag_name }}"
TAG_VERSION="${TAG_VERSION#v}"
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
echo "Release tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)."
exit 1
fi
echo "package_version=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT"
build-macos-x64:
name: Build macOS x64
needs: validate-release
runs-on: macos-15-intel
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build native macOS helpers
run: npm run build:native-helpers
- name: Build macOS x64
run: |
npx tsc
npx vite build
npx electron-builder --mac dmg --x64 --publish never
mv release/Recordly.dmg release/Recordly-x64.dmg
- name: Upload macOS x64 artifact
uses: actions/upload-artifact@v4
with:
name: macos-x64
path: release/Recordly-x64.dmg
if-no-files-found: error
build-macos-arm64:
name: Build macOS arm64
needs: validate-release
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build native macOS helpers
run: npm run build:native-helpers
- name: Build macOS arm64
run: |
npx tsc
npx vite build
npx electron-builder --mac dmg --arm64 --publish never
mv release/Recordly.dmg release/Recordly-arm64.dmg
- name: Upload macOS arm64 artifact
uses: actions/upload-artifact@v4
with:
name: macos-arm64
path: release/Recordly-arm64.dmg
if-no-files-found: error
build-windows-x64:
name: Build Windows x64
needs: validate-release
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build Windows x64
shell: pwsh
run: |
npm run build:cursor-monitor
npx tsc
npx vite build
npx electron-builder --win nsis --x64 --publish never
Rename-Item -Path release/Recordly.exe -NewName Recordly-windows-x64.exe
- name: Upload Windows x64 artifact
uses: actions/upload-artifact@v4
with:
name: windows-x64
path: release/Recordly-windows-x64.exe
if-no-files-found: error
build-linux-x64:
name: Build Linux x64
needs: validate-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build Linux x64
run: |
npx tsc
npx vite build
npx electron-builder --linux AppImage --x64 --publish never
mv release/Recordly.AppImage release/Recordly-linux-x64.AppImage
- name: Upload Linux x64 artifact
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: release/Recordly-linux-x64.AppImage
if-no-files-found: error
publish-release:
name: Publish release
needs:
- validate-release
- build-macos-x64
- build-macos-arm64
- build-windows-x64
- build-linux-x64
runs-on: ubuntu-latest
steps:
- name: Download macOS x64 artifact
uses: actions/download-artifact@v4
with:
name: macos-x64
path: release-assets
- name: Download macOS arm64 artifact
uses: actions/download-artifact@v4
with:
name: macos-arm64
path: release-assets
- name: Download Windows x64 artifact
uses: actions/download-artifact@v4
with:
name: windows-x64
path: release-assets
- name: Download Linux x64 artifact
uses: actions/download-artifact@v4
with:
name: linux-x64
path: release-assets
- name: Create or update release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.tag_name }}
commit: ${{ github.event.inputs.source_ref }}
name: ${{ github.event.inputs.release_name }}
body: ${{ github.event.inputs.release_notes }}
makeLatest: ${{ github.event.inputs.make_latest }}
allowUpdates: true
replacesArtifacts: true
artifactErrorsFailBuild: true
artifacts: |
release-assets/Recordly-arm64.dmg
release-assets/Recordly-x64.dmg
release-assets/Recordly-windows-x64.exe
release-assets/Recordly-linux-x64.AppImage