v1.4.0 #29
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 CLI | |
| on: | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| jobs: | |
| release-cli: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| args: release --clean | |
| workdir: ./ | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-version: | |
| needs: [release-cli] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: v4.x | |
| fetch-depth: 0 | |
| - name: Update version file | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "Updating version to $TAG" | |
| sed -i "s/^\tversion = \".*\"/\tversion = \"$TAG\"/" internal/version/checker.go | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add internal/version/checker.go | |
| git commit -m "chore: bump version to $TAG" | |
| git push origin v4.x | |
| # Move the tag to point to the new commit with updated version | |
| git tag -d "$TAG" || true | |
| git tag "$TAG" | |
| git push origin "refs/tags/$TAG" --force |