Merge pull request #8 from reims-go/ci/release-dispatch
CI / test (push) Canceled after 0s

ci(release): allow dispatching the package build for an existing tag
This commit is contained in:
千川白浪 authored and GitHub committed 2026-12-05 17:11:32 +08:00
commit ec273afc3b
1 file changed
+14 -2
+14 -2
View File
@@ -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