From 1ab3e49d4888ad9b79b5eccd13b7a3c36885f2df Mon Sep 17 00:00:00 2001 From: Sion Smith Date: Thu, 4 Jun 2026 14:46:44 +0100 Subject: [PATCH] fix: release workflow tag dispatch input --- .github/workflows/auto-tag.yml | 2 +- .github/workflows/release.yml | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index a5b30b1..453f0bd 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -62,4 +62,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - gh workflow run release.yml --ref "v${{ steps.version.outputs.version }}" + gh workflow run release.yml --ref "$GITHUB_REF_NAME" -f tag="v${{ steps.version.outputs.version }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b363c5..e8fd61d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,14 +5,22 @@ permissions: on: workflow_dispatch: + inputs: + tag: + description: Release tag to publish, for example v0.1.2 + required: true + type: string push: tags: - "v*.*.*" concurrency: - group: release-${{ github.ref_name }} + group: release-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }} cancel-in-progress: false +env: + RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }} + jobs: create-release: runs-on: ubuntu-latest @@ -22,18 +30,18 @@ jobs: - name: Extract changelog run: | set -euo pipefail - VERSION="${GITHUB_REF_NAME#v}" + VERSION="${RELEASE_TAG#v}" awk "/^## \\[${VERSION}\\]/{found=1; next} /^## \\[/{if(found) exit} found{print}" CHANGELOG.md > release_notes.md if [ ! -s release_notes.md ]; then - echo "Release ${GITHUB_REF_NAME}" > release_notes.md + echo "Release ${RELEASE_TAG}" > release_notes.md fi - name: Create GitHub release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create "$GITHUB_REF_NAME" \ - --title "$GITHUB_REF_NAME" \ + gh release create "$RELEASE_TAG" \ + --title "$RELEASE_TAG" \ --notes-file release_notes.md \ --verify-tag @@ -84,7 +92,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - gh release upload "$GITHUB_REF_NAME" semrush-${{ matrix.target }}.* --clobber + gh release upload "$RELEASE_TAG" semrush-${{ matrix.target }}.* --clobber homebrew: needs: upload-assets @@ -100,8 +108,8 @@ jobs: exit 0 fi - VERSION="${GITHUB_REF_NAME#v}" - BASE_URL="https://github.com/osodevops/semrush-cli/releases/download/${GITHUB_REF_NAME}" + VERSION="${RELEASE_TAG#v}" + BASE_URL="https://github.com/osodevops/semrush-cli/releases/download/${RELEASE_TAG}" curl -fsSL "${BASE_URL}/semrush-aarch64-apple-darwin.tar.gz" -o arm64.tar.gz curl -fsSL "${BASE_URL}/semrush-x86_64-apple-darwin.tar.gz" -o x86_64_mac.tar.gz