From 7ac731a97989fcbce4c4c4df35cc4dcdfe4c04e6 Mon Sep 17 00:00:00 2001 From: hazptr <36674601+hazptr@users.noreply.github.com> Date: Sun, 22 Nov 2026 15:25:39 +0000 Subject: [PATCH] Build a release's artifacts on JitPack after releasing --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 2 ++ 2 files changed, 35 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a0deb7..755431f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -176,3 +176,36 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --draft=false --latest + + # JitPack builds a tag on its first request, which can outlast a Gradle download timeout. Ask for it here, so the + # extensions-source pin bump (opened by Renovate on the new release) resolves the artifacts at once. + jitpack: + name: Build the artifacts on JitPack + needs: release + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + steps: + - name: Checkout tag + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Request the tag's artifacts until JitPack serves them + run: | + base="https://jitpack.io/com/github/${GITHUB_REPOSITORY%%/*}/${GITHUB_REPOSITORY#*/}" + modules=(contract) + for dir in api/*/; do modules+=("api-$(basename "$dir")"); done + for module in "${modules[@]}"; do + url="$base/$module/$GITHUB_REF_NAME/$module-$GITHUB_REF_NAME.pom" + for _ in $(seq 1 25); do + if curl -sf -o /dev/null --max-time 300 "$url"; then + echo "$module $GITHUB_REF_NAME is on JitPack" + continue 2 + fi + sleep 60 + done + echo "::error::JitPack doesn't serve $module $GITHUB_REF_NAME: https://jitpack.io/com/github/${GITHUB_REPOSITORY}/$GITHUB_REF_NAME/build.log" + exit 1 + done diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bafc444..36e7aee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,6 +143,8 @@ JitPack builds the `contract` and `api-*` artifacts for a tag when someone first (`jitpack.yml`; PR checks run the same `publishToMavenLocal`). Consumers can also request a commit hash instead of a tag (`com.github.keiyoushi.runtime:contract:`), so a fix to the published libraries alone doesn't need a runtime release. +After a release, `release.yml` requests the tag's artifacts until JitPack serves them, so +Renovate's pin bump in extensions-source resolves them at once. The signing secrets (`KEYSTORE_B64`, `KEYSTORE_PASSWORD`, `KEY_ALIAS`, `KEY_PASSWORD`) belong in the `release` environment (Settings → Environments), not in the repository's secrets. A repo