fix: fix version command #8
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: [ main ] | |
| # Prevent concurrent releases | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: zon-ubuntu-general-dind | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| upload_url: ${{ steps.release.outputs.upload_url }} | |
| html_url: ${{ steps.release.outputs.html_url }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| name: Checkout | |
| with: | |
| fetch-depth: 0 | |
| - name: Run release-please | |
| uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4 | |
| id: release | |
| with: | |
| release-type: go # this requires a "CHANGELOG.md" file | |
| publish: | |
| needs: release | |
| if: needs.release.outputs.releases_created == 'true' | |
| runs-on: zon-ubuntu-general-dind | |
| env: | |
| GO_VERSION: "1.25" | |
| steps: | |
| - name: Debug release outputs | |
| run: | | |
| echo "Event: ${{ github.event_name }}" | |
| echo "Releases created: ${{ needs.release.outputs.releases_created }}" | |
| echo "Tag name: ${{ needs.release.outputs.tag_name }}" | |
| echo "Upload URL: ${{ needs.release.outputs.upload_url }}" | |
| echo "Release URL: ${{ needs.release.outputs.html_url }}" | |
| echo "Current ref: $GITHUB_REF" | |
| echo "Current SHA: $GITHUB_SHA" | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| name: Checkout | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ needs.release.outputs.tag_name }} | |
| - name: Setup Go | |
| uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6 | |
| with: | |
| go-version: "^${{ env.GO_VERSION }}" | |
| cache: true | |
| cache-dependency-path: go.sum | |
| - name: Install dependencies | |
| run: go get . | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: '~> v2' | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |