From 5e9b1ea6635bed69f89bde0233b38858fef2814d Mon Sep 17 00:00:00 2001 From: max-voitcov Date: Wed, 26 Aug 2026 01:52:53 +0300 Subject: [PATCH] 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. --- .gitea/workflows/release.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 24a9f98..7a32dc0 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -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