v0.1.7 #8
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 | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| build-and-bump-tap: | |
| runs-on: macos-14 # Apple Silicon runner | |
| env: | |
| HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Setup project | |
| run: | | |
| uv python install 3.13 | |
| make setup | |
| - name: Build binary | |
| run: make build | |
| - name: Smoke test binary | |
| run: make smoke | |
| - name: Package tarball | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| TAR="garmin-cli-${VERSION}-macos.tar.gz" | |
| tar -czf "$TAR" -C dist gc | |
| echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
| echo "TAR=$TAR" >> "$GITHUB_ENV" | |
| - name: Compute sha256 | |
| run: | | |
| SHA256=$(shasum -a 256 "$TAR" | awk '{print $1}') | |
| echo "SHA256=$SHA256" >> "$GITHUB_ENV" | |
| - name: Upload release asset | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload "$GITHUB_REF_NAME" "$TAR" --clobber | |
| - name: Bump tap formula | |
| run: | | |
| URL="https://github.com/voydz/garmin-cli/releases/download/${GITHUB_REF_NAME}/${TAR}" | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| brew tap voydz/homebrew-tap | |
| brew bump-formula-pr voydz/tap/garmin-cli \ | |
| --url "$URL" \ | |
| --sha256 "$SHA256" |