chore(release): cut v0.5.3 (#91) #4
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 | |
| # Cut a release when a v* tag is pushed: build the macOS (.dmg, ad-hoc signed) | |
| # and Linux (.tar.gz) packages via `native package`, then publish a GitHub | |
| # release with both artifacts attached. See RELEASING.md for the runbook. | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| package: | |
| name: package (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| target: macos | |
| build_flags: "" | |
| artifact: "zig-out/package/*.dmg" | |
| - os: ubuntu-latest | |
| target: linux | |
| build_flags: "-Dplatform=linux" | |
| artifact: "zig-out/package/*.tar.gz" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Install GTK (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libgtk-4-dev libwebkitgtk-6.0-dev | |
| - name: Install Native SDK CLI | |
| run: npm install -g @native-sdk/cli@0.4.1 | |
| - name: Doctor (strict, macOS) | |
| if: runner.os == 'macOS' | |
| run: native doctor --strict | |
| - name: Doctor (Linux) | |
| if: runner.os == 'Linux' | |
| run: native doctor | |
| - name: Build release binary | |
| run: native build ${{ matrix.build_flags }} | |
| - name: Package (Linux) | |
| if: runner.os == 'Linux' | |
| run: native package --target linux --archive | |
| - name: Package (macOS) | |
| # native package signs the space-free studio.app, then the script | |
| # renames it to "OCPP DebugKit Studio.app" and builds the .dmg (the SDK | |
| # can't sign a bundle path with spaces). TAG comes through the | |
| # environment (injection-safe). | |
| if: runner.os == 'macOS' | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: bash scripts/package-macos.sh "${TAG#v}" | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: studio-${{ matrix.target }} | |
| path: ${{ matrix.artifact }} | |
| if-no-files-found: error | |
| publish: | |
| name: publish release | |
| needs: package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # create the release and upload assets | |
| steps: | |
| - name: Download packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Checksums | |
| run: cd dist && sha256sum studio-* | tee SHA256SUMS | |
| - name: Publish GitHub release | |
| # ref_name / repository come in through the environment, never | |
| # interpolated into the script body, so a crafted tag can't inject shell. | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| gh release create "$TAG" dist/* \ | |
| --repo "$REPO" \ | |
| --title "$TAG" \ | |
| --generate-notes \ | |
| --verify-tag |