Release Binaries #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 Binaries | |
| on: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build binaries | |
| run: bash scripts/compile-all.sh | |
| - name: Upload binaries to release | |
| run: | | |
| # If triggered by release, upload to that release. | |
| # If triggered by workflow_dispatch, we can try to upload to the "latest" release if it exists, | |
| # or just skip upload if we don't have a tag. | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| gh release upload ${{ github.event.release.tag_name }} dist/gemini-api-* --clobber | |
| else | |
| echo "Workflow dispatched manually. Skipping release upload as there is no active release event." | |
| echo "Built binaries:" | |
| ls -lh dist/ | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |