release.yml 984 B

123456789101112131415161718192021222324252627282930313233
  1. name: Release
  2. # Pushing a version tag builds the release binaries and creates a draft
  3. # GitHub release with them. Review the draft, then publish it.
  4. # git tag v1.0.0 && git push origin v1.0.0
  5. on:
  6. push:
  7. tags: ["v*"]
  8. permissions:
  9. contents: write # to create the release
  10. jobs:
  11. release:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v7
  15. with:
  16. fetch-depth: 0 # goreleaser needs the tags and history for the changelog
  17. # Release binaries include the Go standard library, so build them
  18. # with the newest Go release to get its security fixes.
  19. - uses: actions/setup-go@v7
  20. with:
  21. go-version: stable
  22. check-latest: true
  23. - name: govulncheck
  24. run: go run golang.org/x/vuln/cmd/govulncheck@v1.9.0 ./...
  25. - uses: goreleaser/goreleaser-action@v7
  26. with:
  27. version: "~> v2"
  28. args: release --clean
  29. env:
  30. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}