Skip to content

Cut Release

Cut Release #50

Workflow file for this run

name: Cut Release
on:
workflow_dispatch:
permissions:
contents: read
env:
VERSION_FILE: pkg/version/version.go
jobs:
tag:
if: ${{ github.repository }} == 'chainguard-dev/malcontent'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: chainguard-dev/actions/setup-gitsign@de56c2728beb0a0f371bff2ce2ee4b8afee4b5e8
- name: Set up Octo-STS
uses: octo-sts/action@e480437973a6f6ac2e9caa40ecabedc870d76395 # v1.0.1
id: octo-sts
with:
scope: chainguard-dev/malcontent
identity: release
- name: Get Version
id: get-version
run: |
VERSION=$(awk -F'"' '/ID string =/ {print $2}' "${VERSION_FILE}")
if [[ ! "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: VERSION is not a valid semver"
exit 1
fi
echo "VERSION=${VERSION}" >> "${GITHUB_OUTPUT}"
- name: Create Release
env:
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
VERSION: ${{ steps.get-version.outputs.VERSION }}
if: ${{ steps.get-version.outputs.VERSION != '' }}
run: |
if [[ ! "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: VERSION is not a valid semver"
exit 1
fi
git config --global tag.gpgsign true
gh release create "${VERSION}" --title "${VERSION}" --notes "Release ${VERSION}" --draft