Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #178 from reload/tag-and-release
Browse files Browse the repository at this point in the history
Create tag and release in workflow
  • Loading branch information
arnested authored Dec 16, 2023
2 parents ae338a9 + 11e843b commit 10f97a4
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 10f97a4

Please sign in to comment.