From 0c8b574e00211739646205bea59c2d97cf7422b2 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Tue, 7 Nov 2023 19:14:39 -0800 Subject: [PATCH] ci/release: Use latest Go, support manual run Use the latest Go (this is needed now), and support manually invoking the release workflow for failed partial releases. --- .github/workflows/release.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a301754..fe40f6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,13 @@ on: push: tags: ['v*'] + workflow_dispatch: + inputs: + version: + description: "Version to release, including the 'v' prefix." + required: true + type: string + permissions: contents: write @@ -13,11 +20,13 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.version || github.ref }} - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x cache: true - name: Install parse-changelog @@ -30,12 +39,18 @@ jobs: with: fetch-depth: 0 - - name: Determine version + - name: Determine version (tagged release) if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') run: | set -eou pipefail REF=${{ github.ref }} echo "VERSION=${REF#refs/tags/v}" >> "$GITHUB_ENV" + - name: Determine version (manual dispatch) + if: github.event_name == 'workflow_dispatch' + run: | + echo "VERSION=${INPUT_VERSION#v}" >> "$GITHUB_ENV" + env: + INPUT_VERSION: ${{ inputs.version }} - name: Extract changelog run: |