1
0

release.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - 'main'
  6. tags:
  7. - 'v*'
  8. pull_request:
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Set up Go
  15. uses: actions/setup-go@v3
  16. with:
  17. go-version: 1.23
  18. - name: Cache Go modules
  19. uses: actions/cache@v3.0.5
  20. with:
  21. path: ~/go/pkg/mod
  22. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  23. restore-keys: |
  24. ${{ runner.os }}-go-
  25. # -
  26. # name: Tests
  27. # run: |
  28. # go mod tidy
  29. # go test -v ./...
  30. - name: Docker Login
  31. uses: docker/login-action@v2
  32. with:
  33. registry: ghcr.io
  34. username: ${{ github.repository_owner }}
  35. password: ${{ secrets.GITHUB_TOKEN }}
  36. - name: Run GoReleaser
  37. uses: goreleaser/goreleaser-action@v3
  38. if: success() && startsWith(github.ref, 'refs/tags/')
  39. with:
  40. version: latest
  41. args: release
  42. env:
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}