Release #9
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: workflow_dispatch # manual trigger | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: ^1.26 | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Test | |
| run: go test -v -covermode=atomic ./... | |
| tag: | |
| name: Tag | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set GitHub Actions as commit author | |
| shell: bash | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Set up Semantic Versioning | |
| run: | | |
| curl -s https://api.github.com/repos/bvieira/sv4git/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux")) | .browser_download_url' | wget -O /tmp/sv4git.tar.gz -qi - \ | |
| && tar -C /usr/local/bin -xzf /tmp/sv4git.tar.gz | |
| - name: Push a new tag | |
| id: push-new-tag | |
| run: | | |
| git sv tag | |
| VERSION=$(git sv cv) | |
| echo "::set-output name=tag::v$VERSION" | |
| outputs: | |
| tag: ${{ steps.push-new-tag.outputs.tag }} | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: [tag] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Semantic Versioning | |
| run: | | |
| curl -s https://api.github.com/repos/bvieira/sv4git/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux")) | .browser_download_url' | wget -O /tmp/sv4git.tar.gz -qi - \ | |
| && tar -C /usr/local/bin -xzf /tmp/sv4git.tar.gz | |
| - name: Set up Go | |
| id: go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: ^1.18 | |
| - name: Create release notes | |
| run: | | |
| git tag -l | |
| git sv rn -t "${{ needs.tag.outputs.tag }}" > release-notes.md | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: release-notes.md | |
| tag_name: ${{ needs.tag.outputs.tag }} |