diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86319c5..4fd1a6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,14 @@ name: Release plugin package on: push: tags: ['v*'] + # A tag push can occasionally fail to start this workflow. Dispatching with + # an existing tag rebuilds the same package from that tag. + workflow_dispatch: + inputs: + tag: + description: 'Existing tag to package and release' + required: true + type: string permissions: contents: write @@ -10,8 +18,12 @@ permissions: jobs: package: runs-on: windows-latest + env: + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ env.RELEASE_TAG }} - uses: actions/setup-go@v6 with: go-version-file: go.mod @@ -55,7 +67,7 @@ jobs: id: package shell: pwsh run: | - $tag = '${{ github.ref_name }}' + $tag = $env:RELEASE_TAG $version = $tag.Substring(1) $manifest = Get-Content -Raw plugin.json | ConvertFrom-Json if ($manifest.version -ne $version) { throw "Tag $tag does not match plugin.json version $($manifest.version)" } @@ -76,4 +88,4 @@ jobs: GH_TOKEN: ${{ github.token }} shell: pwsh run: | - gh release create "${{ github.ref_name }}" "${{ steps.package.outputs.zip_path }}" "${{ steps.package.outputs.sha_path }}" --verify-tag --generate-notes + gh release create "$env:RELEASE_TAG" "${{ steps.package.outputs.zip_path }}" "${{ steps.package.outputs.sha_path }}" --verify-tag --generate-notes