Compare commits

2 Commits
Author SHA1 Message Date
千川白浪 ec273afc3b 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
2026-12-05 17:11:32 +08:00
千川白浪 f408f94e66 ci(release): allow dispatching the package build for an existing tag
A tag push occasionally fails to start this workflow, which leaves the release with no package. Dispatching with an existing tag rebuilds the same package from that tag instead of waiting for another push.
2026-12-05 02:10:20 -07:00
+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