Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
46 lines
1.7 KiB
YAML
46 lines
1.7 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
releaseVersion:
|
|
type: string
|
|
required: true
|
|
description: The release version of this release. Must be a semantic version of the form X.Y.Z
|
|
dry-run:
|
|
type: boolean
|
|
required: true
|
|
description: Dry run, will not push tags to branch and release.
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Validate Input
|
|
run: |
|
|
echo "${{ github.ref_type }}" | perl -ne 'die unless m/^branch$/'
|
|
echo "${{ github.ref_name }}" | perl -ne 'die unless m/^release-\d+\.\d+$/'
|
|
echo "${{ github.event.inputs.releaseVersion }}" | perl -ne 'die unless m/^\d+\.\d+\.\d+$/'
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
- name: Check Actor
|
|
run: |
|
|
# Release actor should be in the OWNER list
|
|
cat OWNERS | grep ${{ github.actor }}
|
|
- name: Prepare
|
|
run: |
|
|
git config user.email "k8s-publishing-bot@users.noreply.github.com"
|
|
git config user.name "Kubernetes Publisher"
|
|
- name: Release Prepare
|
|
run: |
|
|
git tag -a v${{ github.event.inputs.releaseVersion }} -m "version ${{ github.event.inputs.releaseVersion }}"
|
|
- name: Release Perform
|
|
if: ${{ github.event.inputs.dry-run != 'true' }}
|
|
run: |
|
|
git push https://${{ github.token }}@github.com/${{ github.repository }}.git v${{ github.event.inputs.releaseVersion }}
|
|
- name: Publish Release
|
|
if: ${{ github.event.inputs.dry-run != 'true' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create -d --generate-notes v${{ github.event.inputs.releaseVersion }} |