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: Build and Release Binaries | |
| on: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build-binaries: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: linux-x64 | |
| - os: ubuntu-latest | |
| target: linux-arm64 | |
| - os: macos-latest | |
| target: darwin-x64 | |
| - os: macos-latest | |
| target: darwin-arm64 | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Update package.json version | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| jq --arg v "$VERSION" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json | |
| - name: Build web assets | |
| run: bun run build | |
| - name: Build standalone binary | |
| run: bun run build-binary.ts --target=bun-${{ matrix.target }} --outfile=dist/link-cli-${{ github.ref_name }}-${{ matrix.target }} | |
| - name: Generate checksum | |
| working-directory: dist | |
| run: shasum -a 256 link-cli-${{ github.ref_name }}-${{ matrix.target }} > link-cli-${{ github.ref_name }}-${{ matrix.target }}.sha256 | |
| - name: Upload workflow artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: link-cli-${{ github.ref_name }}-${{ matrix.target }} | |
| path: | | |
| dist/link-cli-${{ github.ref_name }}-${{ matrix.target }} | |
| dist/link-cli-${{ github.ref_name }}-${{ matrix.target }}.sha256 | |
| if-no-files-found: error | |
| - name: Upload binary to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload ${{ github.ref_name }} dist/link-cli-${{ github.ref_name }}-${{ matrix.target }} dist/link-cli-${{ github.ref_name }}-${{ matrix.target }}.sha256 --clobber |