Release #4
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: Init Release | |
on: | |
workflow_dispatch: | |
inputs: | |
TARGET_VERSION: | |
description: 'TARGET_VERSION to build manifests (e.g. 2.5.0-rc1) Note: the `v` prefix is not used' | |
required: true | |
type: string | |
jobs: | |
prepare-release: | |
permissions: | |
contents: write # for peter-evans/create-pull-request to create branch | |
pull-requests: write # for peter-evans/create-pull-request to create a PR | |
name: Create new release for ${{ inputs.TARGET_VERSION }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: main | |
- name: Check if TARGET_VERSION is well formed. | |
run: | | |
set -xue | |
# Target version must not contain 'v' prefix | |
if echo "${{ inputs.TARGET_VERSION }}" | grep -e '^v'; then | |
echo "::error::Target version '${{ inputs.TARGET_VERSION }}' should not begin with a 'v' prefix, refusing to continue." >&2 | |
exit 1 | |
fi | |
- name: Create release | |
run: | | |
gh release create v${{ inputs.TARGET_VERSION }} --generate-notes --target main --title New Version Release ${{ inputs.TARGET_VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |