diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86597ac..6bd6f8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: - completed permissions: - contents: read + contents: write jobs: release: @@ -15,8 +15,36 @@ jobs: steps: - uses: actions/checkout@v4 - uses: arnested/go-version-action@v1 - id: version - - run: echo "go-runtime=$(echo -n go${{ steps.version.outputs.go-mod-version }} | tr -d '.')" >> $GITHUB_OUTPUT + id: go-version + - name: Bump version and push tag + uses: anothrNick/github-tag-action@1.67.0 + id: new-version + env: + GITHUB_TOKEN: ${{ github.token }} + WITH_V: true + DEFAULT_BUMP: patch + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + RELEASE_BRANCHES: main + - name: Create release + uses: actions/github-script@v7 + env: + RELEASE_TAG: ${{ steps.new-version.outputs.next }} + with: + script: | + try { + await github.rest.repos.createRelease({ + draft: false, + generate_release_notes: true, + name: process.env.RELEASE_TAG, + owner: context.repo.owner, + prerelease: false, + repo: context.repo.repo, + tag_name: process.env.RELEASE_TAG, + }); + } catch (error) { + core.setFailed(error.message); + } + - run: echo "go-runtime=$(echo -n go${{ steps.go-version.outputs.go-mod-version }} | tr -d '.')" >> $GITHUB_OUTPUT id: runtime - uses: google-github-actions/auth@v2 with: