diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 399e795..0c33dae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,3 +33,19 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GOPRIVATE: github.com/GoCodeAlone/* GONOSUMCHECK: github.com/GoCodeAlone/* + - name: Publish GitHub release + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.RELEASES_TOKEN || github.token }} + script: | + const tag = context.ref.replace('refs/tags/', ''); + const { owner, repo } = context.repo; + const { data: release } = await github.rest.repos.getReleaseByTag({ owner, repo, tag }); + if (release.draft) { + await github.rest.repos.updateRelease({ + owner, + repo, + release_id: release.id, + draft: false, + }); + } diff --git a/.goreleaser.yml b/.goreleaser.yml index c14518c..9ca85d9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -28,6 +28,7 @@ archives: checksum: name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" release: + draft: true github: owner: GoCodeAlone name: workflow-plugin-cicd