diff --git a/.github/workflows/auto-tag-on-release-pr-merge.yml b/.github/workflows/auto-tag-on-release-pr-merge.yml index 2dd9c4d146..b67e4081e0 100644 --- a/.github/workflows/auto-tag-on-release-pr-merge.yml +++ b/.github/workflows/auto-tag-on-release-pr-merge.yml @@ -62,11 +62,13 @@ jobs: -f ref="v$VERSION" - name: Trigger internal release build + id: buildkite + continue-on-error: true env: BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_API_TOKEN }} VERSION: ${{ env.version }} run: | - curl -sf -X POST \ + RESPONSE=$(curl -sf -X POST \ "https://api.buildkite.com/v2/organizations/runway/pipelines/sprout-releases/builds" \ -H "Authorization: Bearer ${BUILDKITE_API_TOKEN}" \ -H "Content-Type: application/json" \ @@ -80,5 +82,13 @@ jobs: \"relay_url\": \"wss://sprout-oss.stage.blox.sqprod.co\", \"publish_latest\": \"true\" } - }" + }") + BUILD_URL=$(echo "$RESPONSE" | jq -r '.web_url // empty') + echo "build-url=$BUILD_URL" >> "$GITHUB_OUTPUT" + echo "::notice::Internal build started: $BUILD_URL" + + - name: Warn on Buildkite trigger failure + if: steps.buildkite.outcome == 'failure' + run: | + echo "::warning::Failed to trigger internal Buildkite build. Trigger manually: https://buildkite.com/runway/sprout-releases" diff --git a/.github/workflows/sync-release-changelog.yml b/.github/workflows/sync-release-changelog.yml index 188d2c04bc..913665ba5c 100644 --- a/.github/workflows/sync-release-changelog.yml +++ b/.github/workflows/sync-release-changelog.yml @@ -143,7 +143,16 @@ jobs: mv "$TMPFILE" CHANGELOG.md - # Skip commit if nothing changed. + # Always update PR body to reflect current commit list. + if [[ -n "$LAST_TAG" ]]; then + PR_HEADER="### Changes since ${LAST_TAG}:"$'\n\n'"${NEW_ENTRIES}" + else + PR_HEADER="Initial release." + fi + PR_BODY="## Release v${VERSION}"$'\n\n'"${PR_HEADER}"$'\n\n'"**To release:** merge this PR. The tag and build will happen automatically." + gh pr edit "$PR_NUMBER" --body "$PR_BODY" + + # Only commit and push if the changelog file actually changed. if git diff --quiet CHANGELOG.md; then echo "Changelog already up to date — nothing to commit" exit 0 @@ -151,15 +160,6 @@ jobs: git add CHANGELOG.md git commit -m "chore(release): sync changelog for v${VERSION}" + git pull --rebase origin "version-bump/${VERSION}" git push origin "HEAD:refs/heads/version-bump/${VERSION}" - - # Update the PR body with the refreshed commit list. - if [[ -n "$LAST_TAG" ]]; then - PR_HEADER="### Changes since ${LAST_TAG}:"$'\n\n'"${NEW_ENTRIES}" - else - PR_HEADER="Initial release." - fi - PR_BODY="## Release v${VERSION}"$'\n\n'"${PR_HEADER}"$'\n\n'"**To release:** merge this PR. The tag and build will happen automatically." - - gh pr edit "$PR_NUMBER" --body "$PR_BODY" - echo "Changelog synced and PR #${PR_NUMBER} body updated" + echo "Changelog synced for v${VERSION}"