You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
930 B

  1. name: "Release"
  2. on:
  3. push:
  4. branches:
  5. - "RC[0-9]/**"
  6. tags:
  7. - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
  8. jobs:
  9. goreleaser:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v2.3.4
  14. with:
  15. fetch-depth: 0
  16. - uses: actions/setup-go@v2
  17. with:
  18. go-version: '1.17'
  19. - name: Build
  20. uses: goreleaser/goreleaser-action@v2
  21. if: ${{ github.event_name == 'pull_request' }}
  22. with:
  23. version: latest
  24. args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
  25. - name: Release
  26. uses: goreleaser/goreleaser-action@v2
  27. if: startsWith(github.ref, 'refs/tags/')
  28. with:
  29. version: latest
  30. args: release --rm-dist
  31. env:
  32. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}