diff --git a/.github/workflows/tagpr.yml b/.github/workflows/tagpr.yml index 9558be0..e36ddbd 100644 --- a/.github/workflows/tagpr.yml +++ b/.github/workflows/tagpr.yml @@ -31,7 +31,7 @@ jobs: major_version_tag_only: true tag: ${{ steps.run-tagpr.outputs.tag }} - release: + assets: needs: tagpr if: needs.tagpr.outputs.tagpr-tag != '' runs-on: macos-latest @@ -49,13 +49,14 @@ jobs: go-version-file: go.mod cache: true - - name: Setup goreleaser - run: | - brew install goreleaser - - - name: Release - run: | - make release + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} dockerimage: needs: tagpr @@ -104,3 +105,13 @@ jobs: org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.version=${{ steps.latest_version.outputs.version }} org.opencontainers.image.source=https://github.com/k1LoW/gh-setup + + release: + needs: [tagpr, assets, dockerimage] + runs-on: ubuntu-latest + steps: + - name: Release + run: | + gh api /repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ needs.tagpr.outputs.tagpr-tag }} --jq .body | gh release edit ${{ needs.tagpr.outputs.tagpr-tag }} --repo ${{ github.repository }} --draft=false --latest --notes-file=- + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index ec01063..415de35 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -77,3 +77,6 @@ nfpms: - rpm bindir: /usr/bin epoch: 1 +release: + draft: true + replace_existing_draft: true diff --git a/.tagpr b/.tagpr index f9898b5..68c6622 100644 --- a/.tagpr +++ b/.tagpr @@ -32,5 +32,6 @@ [tagpr] vPrefix = true releaseBranch = main + release = draft versionFile = version/version.go,action.yml command = "make prerelease_for_tagpr"