docs: document single-command target hook distribution and add integr… #18
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: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-run: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_run: ${{ steps.check.outputs.should_run }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| run.yes | |
| sparse-checkout-cone-mode: false | |
| - name: Check if run.yes exists | |
| id: check | |
| run: | | |
| if [ -f "run.yes" ]; then | |
| echo "should_run=true" >> $GITHUB_OUTPUT | |
| echo "✅ run.yes is present. Proceeding with release." | |
| else | |
| echo "should_run=false" >> $GITHUB_OUTPUT | |
| echo "🚫 run.yes is not present. Skipping release." | |
| fi | |
| goreleaser: | |
| needs: check-run | |
| if: needs.check-run.outputs.should_run == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| cache: true | |
| - name: Go Build Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/Library/Caches/go-build | |
| ~/AppData/Local/go-build | |
| key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}- | |
| ${{ runner.os }}-go-build- | |
| - name: Update rolling tag | |
| if: github.ref == 'refs/heads/master' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} | |
| # Delete the existing release and tag on GitHub to prevent GoReleaser asset collisions | |
| gh release delete v0.0.0 --cleanup-tag -y || true | |
| git tag -f v0.0.0 ${{ github.sha }} | |
| git push -f origin v0.0.0 | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v5 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |