release: v2.0.0-beta.1 #2
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: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write # required by goreleaser to create releases | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| goreleaser: | |
| # macOS runner is required for codesign on the darwin binary. | |
| # Goreleaser cross-compiles Linux and Windows targets from here; | |
| # nfpm (deb/rpm) is pure Go and works from any host. | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # full history for the changelog | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: "~> v2" | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Uncomment and set HOMEBREW_TAP_GITHUB_TOKEN after enabling the | |
| # brews: section in .goreleaser.yaml. | |
| # HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
| - name: Upload dist artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: release-dist | |
| path: | | |
| dist/*.tar.gz | |
| dist/*.zip | |
| dist/*.deb | |
| dist/*.rpm | |
| dist/*_checksums.txt | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| bump-readme: | |
| needs: goreleaser | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| fetch-depth: 1 | |
| - name: Bump install URLs in README | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| VERSION="${TAG#v}" | |
| # Rewrite stable or pre-release version links to the new stable tag. | |
| sed -i -E "s|releases/download/v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?/|releases/download/${TAG}/|g" README.md | |
| sed -i -E "s|stakecli_[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?_|stakecli_${VERSION}_|g" README.md | |
| sed -i -E "s|STAKECLI_VERSION = \"v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?\"|STAKECLI_VERSION = \"${TAG}\"|g" README.md | |
| - name: Commit and push | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| if git diff --quiet README.md; then | |
| echo "README already up to date for ${TAG}" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add README.md | |
| git commit -m "chore(release): bump install URLs to ${TAG}" | |
| git push origin main | |
| publish-accelerator-installer: | |
| needs: goreleaser | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Upload standalone accelerator installer | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ github.ref_name }} | |
| run: gh release upload "${TAG}" scripts/install-accelerator.sh --clobber |