Release #2
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.platform }} ${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux | |
| arch: x64 | |
| os: ubuntu-latest | |
| builder_args: --linux AppImage deb --x64 | |
| - platform: macos | |
| arch: x64 | |
| os: macos-13 | |
| builder_args: --mac dmg zip --x64 | |
| - platform: macos | |
| arch: arm64 | |
| os: macos-14 | |
| builder_args: --mac dmg zip --arm64 | |
| - platform: windows | |
| arch: x64 | |
| os: windows-latest | |
| builder_args: --win portable nsis --x64 | |
| env: | |
| CSC_IDENTITY_AUTO_DISCOVERY: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Test | |
| run: npm test | |
| - name: Build renderer and main | |
| run: npm run build:force | |
| - name: Package app | |
| shell: bash | |
| run: npx electron-builder ${{ matrix.builder_args }} --publish never -c.compression=maximum | |
| - name: Generate checksums | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| from hashlib import sha256 | |
| from pathlib import Path | |
| platform = "${{ matrix.platform }}" | |
| arch = "${{ matrix.arch }}" | |
| release_dir = Path("release") | |
| checksum_path = release_dir / f"SHA256SUMS-{platform}-{arch}.txt" | |
| lines = [] | |
| for path in sorted(release_dir.iterdir()): | |
| if path.is_file() and path.name != checksum_path.name: | |
| lines.append(f"{sha256(path.read_bytes()).hexdigest()} {path.name}") | |
| checksum_path.write_text("\n".join(lines) + "\n", encoding="utf-8") | |
| PY | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: StackDock-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: release/* | |
| if-no-files-found: error | |
| publish: | |
| name: Publish GitHub release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release-artifacts | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: release-artifacts/**/* | |
| generate_release_notes: true |