Create release #2
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
name: Create release | |
on: | |
workflow_run: | |
workflows: [ "Create, Scan and Publish KDM image" ] | |
types: [completed] | |
branches: [release-**] | |
permissions: | |
contents: write | |
packages: write | |
env: | |
GO_VERSION: '1.20' | |
jobs: | |
create-release: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set up Go ${{ env.GO_VERSION }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- id: get-tag | |
name: Get tag | |
run: echo "tag=$(echo ${{ github.event.pull_request.head.ref }} | tr -d release-)" >> $GITHUB_OUTPUT | |
- name: Create tag | |
run: | | |
git tag ${{ steps.get-tag.outputs.tag }} | |
- name: Goreleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
version: latest | |
args: release --rm-dist --timeout 60m --debug | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |