Release #4
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: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g. v0.1.0)' | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| target: bun-darwin-arm64 | |
| artifact: kauri-darwin-arm64 | |
| - os: macos-13 | |
| target: bun-darwin-x64 | |
| artifact: kauri-darwin-x64 | |
| # - os: ubuntu-latest | |
| # target: bun-linux-x64 | |
| # artifact: kauri-linux-x64 | |
| # - os: windows-latest | |
| # target: bun-windows-x64 | |
| # artifact: kauri-windows-x64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - run: bun run embed-migrations | |
| - name: Build binary | |
| run: | | |
| bun build --compile --minify \ | |
| --target=${{ matrix.target }} \ | |
| --outfile dist/${{ matrix.artifact }} \ | |
| src/cli.ts | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: dist/${{ matrix.artifact }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: false | |
| - name: Create GitHub Release | |
| run: | | |
| if [ -f CHANGELOG.md ]; then | |
| NOTES_FLAG="--notes-file CHANGELOG.md" | |
| else | |
| NOTES_FLAG="--generate-notes" | |
| fi | |
| gh release create "${{ github.event.inputs.tag }}" \ | |
| --title "${{ github.event.inputs.tag }}" \ | |
| $NOTES_FLAG \ | |
| artifacts/kauri-darwin-arm64/kauri-darwin-arm64 \ | |
| artifacts/kauri-darwin-x64/kauri-darwin-x64 \ | |
| # artifacts/kauri-linux-x64/kauri-linux-x64 \ | |
| # artifacts/kauri-windows-x64.exe/kauri-windows-x64.exe | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |