Release #1
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: Automatically generate version and manifests on ${{ inputs.TARGET_VERSION }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: releases/${{ inputs.TARGET_VERSION }} | |
- 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 pull request | |
run: gh pr create -H main -B releases/${{ inputs.TARGET_VERSION }} --title 'Create new branch releases/${{ inputs.TARGET_VERSION }} from main' --body 'Create new version ${{ inputs.TARGET_VERSION }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |