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

Release

Release #48

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ["Build and test"]
branches: [main]
types:
- completed
permissions:
contents: write
actions: read
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arnested/go-version-action@v1
id: go-version
- name: Install Go ${{ steps.go-version.outputs.latest }}.x
uses: WillAbides/[email protected]
with:
go-version: ${{ steps.go-version.outputs.latest }}.x
ignore-local: true
- name: Go version
run: go version
- name: Determine next version
id: version
run: |
go install golang.org/x/exp/cmd/gorelease@latest
echo "::set-output name=next::$(gorelease | tee /dev/stderr | grep 'Suggested version:' | cut -f 2 -d : | xargs)"
- name: Create release
uses: actions/github-script@v7
env:
RELEASE_TAG: ${{ steps.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);
}