chore: release 0.6.5 #49
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 Binaries | |
| on: | |
| push: | |
| tags: [ "v*" ] # e.g. v1.4.0 | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # required for gh release | |
| jobs: | |
| #----------------------------------------------------------- | |
| # 1. Build matrix - each row runs on its own VM | |
| #----------------------------------------------------------- | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - target: macos-arm64 | |
| dagger_fn: macos-build | |
| artifact: cross-stream-${{ github.ref_name }}-macos.tar.gz | |
| - target: linux-arm64 | |
| dagger_fn: linux-arm-64-build | |
| artifact: cross-stream-${{ github.ref_name }}-linux-arm64.tar.gz | |
| - target: linux-amd64 | |
| dagger_fn: linux-amd-64-build | |
| artifact: cross-stream-${{ github.ref_name }}-linux-amd64.tar.gz | |
| steps: | |
| # 1) Check out source | |
| - uses: actions/checkout@v4 | |
| # 2) Cache Dagger BuildKit cache (restore and save) | |
| - name: Cache Dagger | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/dagger | |
| key: dagger-${{ runner.os }}-${{ matrix.target }}-${{ github.sha }} | |
| restore-keys: | | |
| dagger-${{ runner.os }}-${{ matrix.target }}- | |
| # 3) Boot the Dagger engine | |
| - name: Setup Dagger | |
| uses: dagger/[email protected] | |
| with: | |
| version: "0.18.14" | |
| # 4) Defensive: pre-pull the engine image | |
| - name: Pre-pull Dagger Engine | |
| run: docker pull registry.dagger.io/engine:v0.18.14 | |
| # 5) Run one Dagger build function and export artifact | |
| - name: Build with Dagger | |
| uses: dagger/[email protected] | |
| with: | |
| version: "0.18.14" | |
| call: ${{ matrix.dagger_fn }} --src upload --src . --version ${{ github.ref_name }} export --path ./artifacts/${{ matrix.artifact }} | |
| # 6) Upload artifact for fan-in job | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ./artifacts/${{ matrix.artifact }} | |
| #----------------------------------------------------------- | |
| # 2. Fan-in job - gather artifacts and create release | |
| #----------------------------------------------------------- | |
| release: | |
| name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Generate changelog if missing | |
| run: | | |
| tag="${{ github.ref_name }}" | |
| changelog="changes/${tag}.md" | |
| if [ ! -f "$changelog" ]; then | |
| # Get the previous tag by sorting all tags and finding the one before current | |
| previous_tag=$(git tag --list 'v*' --sort=-version:refname | grep -A1 "^${tag}$" | tail -1) | |
| if [ -n "$previous_tag" ] && [ "$previous_tag" != "$tag" ]; then | |
| git log --format=%s "${previous_tag}..${tag}" > "$changelog" | |
| else | |
| git log --format=%s "${tag}" > "$changelog" | |
| fi | |
| fi | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| prerelease: ${{ contains(github.ref_name, '-dev.') }} | |
| draft: false | |
| body_path: changes/${{ github.ref_name }}.md | |
| files: artifacts/* |