Let a stranded release be re-run without moving the tag

The v0.2.0 release died twice on the runner -- once OOM-killed by six parallel
builds, once with the host going away mid-compile -- and each time the only way
back was to delete the tag and push it again. That is destructive, it rewrites
published history for a version that may already be half-published, and it is
easy to get wrong under pressure.

Add a workflow_dispatch trigger so the same release can simply be re-run.
goreleaser refuses to release from an untagged commit, so a dispatch can only
ever republish a real tag.

The sdks job derived VERSION from the ref name, which is the tag on a push but
the branch on a dispatch. It now asks git which tag the checked-out commit
carries, with --exact-match so an untagged commit fails loudly instead of
publishing under the previous version. That needs the tags, hence fetch-depth.
This commit is contained in:
max-voitcov
2026-08-26 01:52:53 +03:00
parent 5b106b406d
commit 74b2ba060f
+15 -1
View File
@@ -3,6 +3,12 @@ name: release
on:
push:
tags: ["v*.*.*"]
# A release that dies halfway -- the runner OOMs, the host reboots -- leaves
# the tag pushed and nothing published, and re-pushing a tag to retry it is
# both awkward and destructive. Dispatch re-runs the same release instead.
# goreleaser refuses to run unless the checked-out commit is itself tagged,
# so this can only ever republish a real tag, never main-in-progress.
workflow_dispatch: {}
env:
GO_VERSION: "1.25.x"
@@ -66,6 +72,8 @@ jobs:
- uses: actions/checkout@v4
with:
path: pulumi-dokploy
# Needed for the tag lookup below.
fetch-depth: 0
- uses: actions/checkout@v4
with:
@@ -92,8 +100,14 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# On a tag push the ref name is the tag; on a dispatch it is the branch,
# so ask git what tag this commit carries. --exact-match keeps a dispatch
# from quietly publishing an untagged commit under the previous version.
- name: Derive version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
working-directory: pulumi-dokploy
run: |
TAG="$(git describe --tags --exact-match)"
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
- name: Build SDKs
working-directory: pulumi-dokploy