diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..ba4f8a2 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,37 @@ +name: release-please + +on: + push: + branches: + - main + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release-please.outputs.release_created }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release-please + with: + release-type: go + + release: + runs-on: ubuntu-latest + needs: release-please + if: needs.release-please.outputs.release_created + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 25fc639..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - push: - tags: - - '*' - -name: release -jobs: - release: - name: run goreleaser - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: install go - uses: actions/setup-go@v4 - with: - go-version: '1.19' - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}