Skip to content

Create release

Create release #14

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: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- 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
- uses: ./.github/actions/download-artifact
- name: Parse artifacts and assign GA environment variables
run: |
tag=$(tail -n 1 /tmp/artifacts/tag.txt)
echo "IMG_TAG=$tag" >> $GITHUB_ENV
- name: Checkout the repository at the given SHA from the artifact
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
ref: ${{ env.IMG_TAG }}
- name: Goreleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist --timeout 60m --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}