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

Create tag and release in workflow #178

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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