fix(release): upload assets directly and isolate runtime paths #5
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: Release desktop apps | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: mac | |
| os: macos-latest | |
| builder_args: --mac --x64 --arm64 | |
| release_files: dist/*.dmg dist/*.zip | |
| - platform: windows | |
| os: windows-latest | |
| builder_args: --win --x64 | |
| release_files: dist/*.exe | |
| - platform: linux | |
| os: ubuntu-latest | |
| builder_args: --linux AppImage deb --x64 | |
| release_files: dist/*.AppImage dist/*.deb | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 11.9.0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Verify desktop contract | |
| run: pnpm electron:check | |
| - name: Build standalone web server | |
| run: pnpm build:desktop | |
| - name: Package desktop app | |
| shell: bash | |
| run: pnpm exec electron-builder ${{ matrix.builder_args }} --publish never | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_IDENTITY_AUTO_DISCOVERY: "false" | |
| - name: Upload release assets | |
| if: startsWith(github.ref, 'refs/tags/') | |
| shell: bash | |
| run: gh release upload "$GITHUB_REF_NAME" ${{ matrix.release_files }} --clobber --repo "$GITHUB_REPOSITORY" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release: | |
| name: Publish GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate SHA-256 checksums | |
| run: | | |
| gh api "repos/$GITHUB_REPOSITORY/releases/tags/$GITHUB_REF_NAME" \ | |
| --jq '.assets[] | select(.digest != null) | "\(.digest | sub("^sha256:"; "")) \(.name)"' \ | |
| | sort > SHA256SUMS.txt | |
| test "$(wc -l < SHA256SUMS.txt)" -eq 7 | |
| gh release upload "$GITHUB_REF_NAME" SHA256SUMS.txt --clobber --repo "$GITHUB_REPOSITORY" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish release | |
| run: gh release edit "$GITHUB_REF_NAME" --draft=false --latest --repo "$GITHUB_REPOSITORY" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |