From 60d43edb2a7b1b1fe8c3ccb9badd68745f0b0bf6 Mon Sep 17 00:00:00 2001 From: JeanExtreme002 Date: Sun, 18 Oct 2026 01:47:26 -0300 Subject: [PATCH] ci: request each Go module version on pkg.go.dev after tagging pkg.go.dev never processed go/v1.6.3 even though the proxy and the module index had it, so the docs stayed on v1.6.2 until it was requested by hand. The tag job now asks pkg.go.dev for the version it just tagged (or found already tagged), retrying while it is still processing and only warning if it never confirms. --- .github/workflows/publish.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 967f2e6..fb63020 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -87,6 +87,7 @@ jobs: # module on its own means: the other two packages did not change, so there # is no release tag to hang it from. - name: Tag the Go module + id: tag env: EVENT_NAME: ${{ github.event_name }} RELEASE_TAG: ${{ github.event.release.tag_name }} @@ -124,6 +125,7 @@ jobs: if existing=$(git rev-parse -q --verify "refs/tags/${module_tag}^{commit}"); then if [ "${existing}" = "${commit}" ]; then echo "${module_tag} already points at ${commit}" + echo "version=v${version}" >> "$GITHUB_OUTPUT" exit 0 fi refuse "${module_tag} exists at ${existing}, not ${commit} — a published version is immutable, bump go/flightradarapi/doc.go" @@ -160,6 +162,26 @@ jobs: git tag "${module_tag}" "${commit}" git push origin "${module_tag}" echo "Pushed ${module_tag} at ${commit}" + echo "version=v${version}" >> "$GITHUB_OUTPUT" + + # Best effort: pkg.go.dev can miss a version the proxy already serves. + - name: Request the version on pkg.go.dev + if: >- + steps.tag.outputs.version != '' + && (github.event_name == 'release' || inputs.dry_run == false) + env: + MODULE: github.com/JeanExtreme002/FlightRadarAPI/go@${{ steps.tag.outputs.version }} + run: | + for attempt in $(seq 1 10); do + status=$(curl -s -o /dev/null -w '%{http_code}' -X POST "https://pkg.go.dev/fetch/${MODULE}" || true) + if [ "${status}" = "200" ]; then + echo "pkg.go.dev serves ${MODULE}" + exit 0 + fi + echo "Attempt ${attempt}: pkg.go.dev answered ${status}" + sleep 30 + done + echo "::warning::pkg.go.dev did not confirm ${MODULE}; request it at https://pkg.go.dev/${MODULE}" publish-pypi: needs: verify-versions