Merge pull request #1 from slashdevops/feat/implementation #1
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: | |
| actions: write | |
| contents: write | |
| id-token: write | |
| packages: write | |
| pull-requests: read | |
| security-events: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: ./go.mod | |
| cache: true | |
| - name: Summary Information | |
| run: | | |
| echo "# Release Summary" > "$GITHUB_STEP_SUMMARY" | |
| echo "" >> "$GITHUB_STEP_SUMMARY" | |
| echo "**Repository:** ${{ github.repository }}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "**Actor:** ${{ github.triggering_actor }}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "**Commit ID:** ${{ github.sha }}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "**Tag:** ${{ github.ref_name }}" >> "$GITHUB_STEP_SUMMARY" | |
| echo "" >> "$GITHUB_STEP_SUMMARY" | |
| - name: Format check | |
| run: | | |
| files=$(gofmt -l .) | |
| if [ -n "$files" ]; then | |
| echo "$files" | |
| exit 1 | |
| fi | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test | |
| run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... | |
| - name: Test coverage | |
| run: | | |
| echo "## Test coverage" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| go tool cover -func=coverage.txt | tee -a "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| make_latest: true |