Release v0.8.5.1 #33
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 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: windows | |
| goarch: amd64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| ./scripts/build.sh "$VERSION" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: belmont-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: dist/ | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| - name: Collect binaries and generate checksums | |
| run: | | |
| mkdir -p release/ | |
| find artifacts/ -type f -name 'belmont-*' -exec cp {} release/ \; | |
| cd release/ | |
| sha256sum belmont-* > checksums.txt | |
| - name: Extract changelog entry | |
| id: changelog | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| # Extract the section for this tag from CHANGELOG.md | |
| BODY=$(awk "/^## ${TAG}/{flag=1; next} /^## v/{flag=0} flag" CHANGELOG.md) | |
| # Use a delimiter for multiline output | |
| echo "body<<CHANGELOG_EOF" >> "$GITHUB_OUTPUT" | |
| echo "$BODY" >> "$GITHUB_OUTPUT" | |
| echo "CHANGELOG_EOF" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: ${{ steps.changelog.outputs.body }} | |
| files: release/* |