diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62540dca..f7f6a598 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -285,7 +285,19 @@ jobs: # If we're editing a release in place, we need to upload things ahead of time gh release upload "${{ needs.plan.outputs.tag }}" artifacts/* - gh release edit "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --draft=false + # ⚠️ MANUAL EDIT + # Replacement for the generated line + # gh release edit "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --draft=false + # + # Customize gh release edit call to prevent gh release edit --draft=false from marking the release as latest + # https://github.com/axodotdev/cargo-dist/issues/2244 + export RELEASE_ID=$(gh api repos/{owner}/{repo}/releases --jq '.[] | select(.tag_name == "${{ needs.plan.outputs.tag }}") | .id') + if [ -z "$RELEASE_ID" ]; then + echo "Error: Could not find release ID for tag" + exit 1 + fi + gh api repos/{owner}/{repo}/releases/$RELEASE_ID --method PATCH -f draft=false + # ⚠️ END OF MANUAL EDIT announce: needs: diff --git a/dist-workspace.toml b/dist-workspace.toml index f7f30358..2a6b736c 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -27,6 +27,11 @@ precise-builds = true create-release = false # Use the stage just after plan because we need its output to create the draft release local-artifacts-jobs = ["./create-draft-release"] +# Uncomment this to rerun `dist generate` +# ⚠️ This will overwrite any manual changes to generated files, make sure to re-apply them if they're still relevant +# We need this to prevent gh release edit from marking any release as latest, but cargo-dist does not support that customizing this yet +# https://github.com/axodotdev/cargo-dist/issues/2244 +allow-dirty = ["ci"] [dist.github-custom-runners] aarch64-unknown-linux-musl = "buildjet-2vcpu-ubuntu-2204-arm"