Skip to content

Commit

Permalink
ci/release: Upgrade Go, support manual dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Nov 11, 2023
1 parent d7284c2 commit 6ddb540
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -13,11 +20,14 @@ 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
Expand All @@ -27,15 +37,19 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
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: |
Expand Down

0 comments on commit 6ddb540

Please sign in to comment.