From b77c90482ad84e702fae27d132c290ab0b066cb5 Mon Sep 17 00:00:00 2001 From: Jared Randall Date: Wed, 26 Aug 2026 19:31:25 -0700 Subject: [PATCH] ci: support manual release publication --- .github/workflows/release.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa9edf9..771f126 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,15 @@ on: push: tags: - v* + workflow_dispatch: + inputs: + tag: + description: Existing release tag to publish + required: true + type: string concurrency: - group: release-${{ github.workflow }}-${{ github.ref }} + group: release-${{ github.workflow }}-${{ inputs.tag || github.ref }} cancel-in-progress: false jobs: @@ -34,6 +40,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ inputs.tag || github.ref }} - name: Install sqlc uses: sqlc-dev/setup-sqlc@bac53b7fb28c039a6c7f5736fd1e89744021bdd6 # v5.0.0 @@ -70,12 +77,15 @@ jobs: timeout-minutes: 15 permissions: contents: write + env: + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false + ref: ${{ inputs.tag || github.ref }} - name: Install Rust stable uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable @@ -99,18 +109,18 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then + if gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then exit 0 fi - if [[ "${GITHUB_REF_NAME}" == *-* ]]; then - gh release create "${GITHUB_REF_NAME}" \ - --title "${GITHUB_REF_NAME}" \ + if [[ "${RELEASE_TAG}" == *-* ]]; then + gh release create "${RELEASE_TAG}" \ + --title "${RELEASE_TAG}" \ --generate-notes \ --prerelease else - gh release create "${GITHUB_REF_NAME}" \ - --title "${GITHUB_REF_NAME}" \ + gh release create "${RELEASE_TAG}" \ + --title "${RELEASE_TAG}" \ --generate-notes \ --latest fi @@ -119,7 +129,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh release upload "${GITHUB_REF_NAME}" \ + gh release upload "${RELEASE_TAG}" \ dist/sqlc-gen-sqlx.wasm \ dist/sqlc-gen-sqlx.wasm.sha256 \ --clobber @@ -139,6 +149,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ inputs.tag || github.ref }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable