Merge pull request #20 from VirtualMetric/DT-803 #12
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 | |
| # Triggered automatically when you push a tag like `v0.1.0`. There is no | |
| # manual "build a release" step — git tag + push is the entire workflow: | |
| # | |
| # git tag v0.1.0 | |
| # git push origin v0.1.0 | |
| # | |
| # What this does: | |
| # 1. Cross-compiles cmd/harness for linux/macOS/windows × amd64/arm64. | |
| # 2. Wraps each binary into a tar.gz/zip with README + LICENSE. | |
| # 3. Computes SHA256 checksums. | |
| # 4. Auto-generates the changelog from commits since the previous tag. | |
| # 5. Pushes everything to a GitHub Release at the tag. | |
| # | |
| # Configured via .goreleaser.yml at the repo root. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| # GoReleaser needs `contents: write` to create the release + upload assets. | |
| contents: write | |
| jobs: | |
| release: | |
| name: Build & publish release artifacts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| # Fetch full history AND tags so GoReleaser can describe the | |
| # current commit and resolve the previous tag for changelog | |
| # generation. fetch-depth: 0 alone has a quirk on tag-triggered | |
| # runs where lightweight tags aren't always present in the | |
| # local clone — fetch-tags: true is the belt to the suspenders. | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "stable" | |
| # Sanity print so a failed-but-silent release surfaces a real | |
| # diagnostic in the run log instead of a 30-second false-success. | |
| - name: Verify tag is visible to git | |
| run: | | |
| echo "GITHUB_REF=$GITHUB_REF" | |
| echo "git describe (exact): $(git describe --tags --exact-match 2>&1 || true)" | |
| echo "git describe (any): $(git describe --tags --always 2>&1)" | |
| git tag -l | head | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "~> v2" | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |