Cut Release #8
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: Cut Release | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
env: | |
VERSION_FILE: pkg/version/version.go | |
jobs: | |
tag: | |
if: ${{ github.repository }} == 'chainguard-dev/bincapz' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: chainguard-dev/actions/setup-gitsign@e82b4e5ae10182af72972addcb3fedf7454621c8 | |
- name: Set up Octo-STS | |
uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f # v1.0.0 | |
id: octo-sts | |
with: | |
scope: chainguard-dev/bincapz | |
identity: release | |
- name: Get Version | |
id: get-version | |
run: | | |
VERSION=$(awk -F'"' '/ID string =/ {print $2}' ${{ env.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 }} | |
if: ${{ steps.get-version.outputs.VERSION != '' }} | |
run: | | |
VERSION=${{ steps.get-version.outputs.VERSION }} | |
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 |