Release "Update gardener-controlplane to v1.109.1 (#1902) Co-authored-by: 23t-machine-user <[email protected]>" by @23t-machine-user #463
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: Release | |
run-name: Release "${{ inputs.version || github.event.head_commit.message }}" by @${{ github.actor }} | |
permissions: | |
contents: write | |
packages: write | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "New version to be released. Format: 1.3.3-7" | |
required: true | |
type: string | |
push: | |
branches: | |
- release-v* | |
concurrency: | |
group: release-${{ inputs.version }}-${{ github.ref_name }} | |
cancel-in-progress: false | |
jobs: | |
prepare: | |
runs-on: ubuntu-24.04 | |
name: Prepare | |
env: | |
version: ${{ github.event.inputs.version }} | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install yarn | |
run: npm i -g yarn | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
token: "${{ secrets.GH_TOKEN_23T_MACHINE_USER }}" | |
fetch-depth: 0 | |
- name: Configure git | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Configure version to release | |
id: version | |
env: | |
COMMIT_MESSAGE: "${{ github.event.head_commit.message }}" | |
run: | | |
if [[ -z "$version" ]]; then | |
version=$(echo "$COMMIT_MESSAGE" | grep -oP "Update gardener-controlplane to v\K([0-9]{1,}[.][0-9]{1,}[.][0-9]{1,})")-0 | |
fi | |
echo "version=$version" | tee $GITHUB_ENV | tee $GITHUB_OUTPUT | |
- name: Prepare release | |
run: "hack/release/prepare.sh $version" | |
- name: Github Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: /tmp/release-body.md | |
tag_name: v${{ steps.version.outputs.version }} | |
make_latest: ${{ env.RELEASE_AS_LATEST }} # set in prepare.sh | |
upload-oci: | |
runs-on: ubuntu-24.04 | |
name: Upload OCI | |
if: success('prepare') | |
needs: | |
- prepare | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: "v${{ needs.prepare.outputs.version }}" | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Upload to harbor container registry | |
env: | |
tag: "v${{ needs.prepare.outputs.version }}" | |
run: hack/release/upload-oci.sh |