chore(release): v0.7.11 #117
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Desktop Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to release (e.g., 0.1.0)' | |
| required: true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| platform: mac | |
| arch: arm64 | |
| - os: macos-latest | |
| platform: mac | |
| arch: x64 | |
| - os: windows-latest | |
| platform: win | |
| arch: x64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| name: Build ${{ matrix.platform }}-${{ matrix.arch }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build shared packages | |
| run: pnpm --filter @pairux/shared-types build | |
| # macOS code signing | |
| - name: Import macOS certificates | |
| if: matrix.platform == 'mac' | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| if [ -n "$APPLE_CERTIFICATE" ]; then | |
| echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12 | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
| security default-keychain -s build.keychain | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
| security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain | |
| rm certificate.p12 | |
| fi | |
| # Windows code signing | |
| - name: Setup Windows signing | |
| if: matrix.platform == 'win' | |
| env: | |
| WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }} | |
| run: | | |
| if ($env:WINDOWS_CERTIFICATE) { | |
| [IO.File]::WriteAllBytes("certificate.pfx", [Convert]::FromBase64String($env:WINDOWS_CERTIFICATE)) | |
| } | |
| shell: pwsh | |
| # Linux dependencies for electron-builder | |
| - name: Install Linux dependencies | |
| if: matrix.platform == 'linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libarchive-tools rpm squashfs-tools | |
| - name: Write .env file | |
| run: printenv ENV_FILE > apps/desktop/.env | |
| env: | |
| ENV_FILE: ${{ secrets.ENV_FILE }} | |
| - name: Build desktop app | |
| run: pnpm --filter @pairux/desktop build | |
| env: | |
| # TURN server configuration | |
| TURN_SERVER_URL: ${{ secrets.TURN_SERVER_URL }} | |
| TURN_SERVER_USERNAME: ${{ secrets.TURN_SERVER_USERNAME }} | |
| TURN_SERVER_CREDENTIAL: ${{ secrets.TURN_SERVER_CREDENTIAL }} | |
| TURNS_SERVER_URL: ${{ secrets.TURNS_SERVER_URL }} | |
| - name: Package desktop app | |
| working-directory: apps/desktop | |
| run: npx electron-builder --${{ matrix.platform }} --${{ matrix.arch }} --publish never | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # macOS notarization (afterSign hook) | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| # Windows signing | |
| WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }} | |
| # Guard against corrupt AppImage builds reaching users. electron-builder | |
| # has intermittently produced AppImages with a corrupt squashfs (valid | |
| # superblock, but unreadable id/inode tables -> "sqfs_traverse_open error" | |
| # / "Failed to extract AppImage" at runtime). Fully extract the squashfs | |
| # here so a bad artifact fails the build instead of being published. | |
| - name: Verify AppImage integrity | |
| if: matrix.platform == 'linux' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| imgs=(apps/desktop/out/*.AppImage) | |
| if [ ${#imgs[@]} -eq 0 ]; then | |
| echo "::error::No AppImage was produced by electron-builder" | |
| exit 1 | |
| fi | |
| for img in "${imgs[@]}"; do | |
| echo "Verifying squashfs of $img" | |
| # Locate the appended squashfs by scanning for its 'hsqs' magic and | |
| # keeping the first candidate that has a VALID superblock (the magic | |
| # bytes also occur by chance inside the ELF runtime). This is | |
| # arch-independent — the arm64 runtime can't be executed on the x64 | |
| # runner, but unsquashfs reads the gzip data regardless of CPU arch. | |
| off="" | |
| while IFS=: read -r cand _; do | |
| if unsquashfs -s -o "$cand" "$img" >/dev/null 2>&1; then | |
| off="$cand"; break | |
| fi | |
| done < <(grep -abo 'hsqs' "$img") | |
| if [ -z "${off:-}" ]; then | |
| echo "::error::no valid squashfs superblock found in $img" | |
| exit 1 | |
| fi | |
| echo " squashfs offset=$off" | |
| rm -rf /tmp/appverify | |
| if ! unsquashfs -o "$off" -d /tmp/appverify "$img" >/tmp/unsquashfs.log 2>&1; then | |
| echo "::error::$img has a corrupt squashfs (extraction failed) — not publishing" | |
| tail -30 /tmp/unsquashfs.log | |
| exit 1 | |
| fi | |
| # The extracted tree must contain the real app payload. | |
| if [ ! -e /tmp/appverify/AppRun ] && [ ! -d /tmp/appverify/usr ] && [ ! -d /tmp/appverify/resources ]; then | |
| echo "::error::$img extracted but is missing expected contents" | |
| ls -la /tmp/appverify | |
| exit 1 | |
| fi | |
| echo " OK: $img extracted cleanly" | |
| done | |
| - name: Extract ffmpeg binary | |
| shell: bash | |
| run: | | |
| FFMPEG_PATH=$(node -e "try { console.log(require('@ffmpeg-installer/ffmpeg').path) } catch(e) { process.exit(1) }") | |
| if [ -n "$FFMPEG_PATH" ] && [ -f "$FFMPEG_PATH" ]; then | |
| EXT="" | |
| if [ "${{ matrix.platform }}" = "win" ]; then EXT=".exe"; fi | |
| cp "$FFMPEG_PATH" "apps/desktop/out/ffmpeg-${{ matrix.platform }}-${{ matrix.arch }}${EXT}" | |
| gzip "apps/desktop/out/ffmpeg-${{ matrix.platform }}-${{ matrix.arch }}${EXT}" | |
| echo "Extracted ffmpeg to ffmpeg-${{ matrix.platform }}-${{ matrix.arch }}${EXT}.gz" | |
| else | |
| echo "WARNING: ffmpeg binary not found for this platform" | |
| fi | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: desktop-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| apps/desktop/out/*.dmg | |
| apps/desktop/out/*.zip | |
| apps/desktop/out/*.exe | |
| apps/desktop/out/*.AppImage | |
| apps/desktop/out/*.deb | |
| apps/desktop/out/*.rpm | |
| apps/desktop/out/*.gz | |
| retention-days: 7 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get version | |
| id: version | |
| env: | |
| INPUT_VERSION: ${{ github.event.inputs.version }} | |
| REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| if [ -n "$INPUT_VERSION" ]; then | |
| VERSION="$INPUT_VERSION" | |
| else | |
| VERSION="$REF_NAME" | |
| fi | |
| # Strip 'v' prefix if present | |
| VERSION="${VERSION#v}" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag=v$VERSION" >> $GITHUB_OUTPUT | |
| # Only mark as prerelease if version has prerelease suffix (alpha, beta, rc) | |
| if [[ "$VERSION" == *"-alpha"* ]] || [[ "$VERSION" == *"-beta"* ]] || [[ "$VERSION" == *"-rc"* ]]; then | |
| echo "prerelease=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "prerelease=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: desktop-* | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -la dist/ | |
| - name: Generate checksums | |
| run: | | |
| cd dist | |
| sha256sum * > SHA256SUMS.txt | |
| cat SHA256SUMS.txt | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: PairUX ${{ steps.version.outputs.version }} | |
| draft: false | |
| prerelease: ${{ steps.version.outputs.prerelease }} | |
| generate_release_notes: true | |
| files: | | |
| dist/* | |
| env: | |
| # Use PKG_SUBMIT_TOKEN (PAT) to trigger submit-packages workflow | |
| # GITHUB_TOKEN doesn't trigger other workflows | |
| GITHUB_TOKEN: ${{ secrets.PKG_SUBMIT_TOKEN || secrets.GITHUB_TOKEN }} |