Build and Release #1
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: Build and Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-desktop: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| script: dist:linux | |
| - os: windows-latest | |
| platform: win | |
| arch: x64 | |
| script: dist:win | |
| - os: macos-latest | |
| platform: mac | |
| arch: arm64 | |
| script: dist:mac-arm64 | |
| - os: macos-13 | |
| platform: mac | |
| arch: x64 | |
| script: dist:mac-x64 | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build Desktop | |
| run: bun run ${{ matrix.script }} | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: desktop-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| dist/*.dmg | |
| dist/*.AppImage | |
| dist/*.exe | |
| release: | |
| needs: [build-desktop] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download All Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release-assets | |
| merge-multiple: true | |
| - name: List Release Assets | |
| run: | | |
| echo "Release assets:" | |
| ls -la release-assets/ | |
| - name: Generate Checksums | |
| run: | | |
| cd release-assets | |
| sha256sum * > SHA256SUMS || true | |
| cat SHA256SUMS | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| draft: false | |
| generate_release_notes: true | |
| files: release-assets/* | |
| fail_on_unmatched_files: false |