This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from reload/tag-and-release
Create tag and release in workflow
- Loading branch information
Showing
1 changed file
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,44 @@ on: | |
- completed | ||
|
||
permissions: | ||
contents: read | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
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/[email protected] | ||
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: | ||
|