Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/scripts/auto_release_internal/compute_version.sh

This file was deleted.

14 changes: 0 additions & 14 deletions .github/scripts/auto_release_internal/create_release.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .github/scripts/auto_release_internal/trigger_publish.sh

This file was deleted.

20 changes: 0 additions & 20 deletions .github/scripts/dispatch_release/create_release.sh

This file was deleted.

8 changes: 5 additions & 3 deletions .github/scripts/dispatch_release/detect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ for key in "${ORDER[@]}"; do
done

if [[ ${#PACKAGES[@]} -eq 0 ]]; then
echo "Error: select at least one package"
exit 1
# No explicit selection: the plan step auto-detects packages with pending
# news fragments (or, for release-from-prerelease, packages whose changelog
# is topped by an alpha).
echo "No packages checked; deferring to auto-detection in the plan step."
fi

JOINED=$(IFS=,; echo "${PACKAGES[*]}")
JOINED=$(IFS=,; echo "${PACKAGES[*]:-}")
echo "packages=[$JOINED]" >> "$GITHUB_OUTPUT"
66 changes: 66 additions & 0 deletions .github/scripts/dispatch_release/open_release_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
set -euo pipefail

: "${GH_TOKEN:?}"
: "${ACTION:?}"
: "${REF_NAME:?}"
: "${RELEASES:?}"
: "${GITHUB_RUN_ID:?}"

# Final versions publish from main — except hotfix trains, which publish
# directly from their r/hotfix/** branch, so the PR targets it instead.
BASE="main"
if [[ "$REF_NAME" == r/hotfix/* ]]; then
BASE="$REF_NAME"
fi
Comment thread
masenf marked this conversation as resolved.

BRANCH="release/${ACTION}-${GITHUB_RUN_ID}"
SUMMARY=$(echo "$RELEASES" | jq -r '[.[] | "\(.package)@\(.next)"] | join(", ")')

BODY_FILE="${RUNNER_TEMP}/release_pr_body.md"
{
echo "Materialized changelogs for release action \`${ACTION}\` (dispatched on \`${REF_NAME}\`)."
echo ""
echo "| Package | Current | Next | Tag |"
echo "|---------|---------|------|-----|"
echo "$RELEASES" | jq -r '.[] | "| `\(.package)` | `\(if .current == "" then "<none>" else .current end)` | `\(.next)` | `\(.tag)` |"'
echo ""
echo "Merging this PR lands the versions above for release: the push to \`${BASE}\`"
echo "triggers the \`release_from_changelog\` workflow, which builds each package and"
echo "then waits for \`pypi\` environment approval before uploading; the tag and"
echo "GitHub release are created only after a successful upload. If a publish"
echo "fails, fix the problem on top of the changelog bump — the next push retries"
echo "automatically."
} > "$BODY_FILE"

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Stage the changelog rewrites (including first-release creations); a
# directory pathspec with a wildcard never matches, so name the files. The
# consumed news fragments are already staged by towncrier's git rm, and
# `commit -a` below picks up any tracked change it left unstaged — while
# never committing untracked stray files.
git add -- CHANGELOG.md 'packages/*/CHANGELOG.md'
if git diff --cached --quiet && git diff --quiet; then
echo "Error: materialization produced no changes; nothing to release."
exit 1
fi
git commit -a -m "Materialize changelogs for ${SUMMARY} (${ACTION})"
Comment thread
masenf marked this conversation as resolved.
# The token is supplied via gh's credential helper so it never appears in a
# remote URL or process argv.
git -c credential.helper= -c 'credential.helper=!gh auth git-credential' \
push origin "HEAD:refs/heads/${BRANCH}"

PR_URL=$(gh pr create --base "$BASE" --head "$BRANCH" --title "Release ${SUMMARY}" --body-file "$BODY_FILE")

# The PR only rewrites changelogs and deletes consumed news fragments, so the
# changelog fragment check does not apply. Label failure is non-fatal.
gh pr edit "$PR_URL" --add-label skip-changelog || echo "::notice::could not add skip-changelog label to $PR_URL"

{
echo "## Release PR opened"
echo ""
echo "$PR_URL"
echo ""
echo "Releases: ${SUMMARY}"
} >> "$GITHUB_STEP_SUMMARY"
209 changes: 0 additions & 209 deletions .github/scripts/dispatch_release/plan.py

This file was deleted.

Loading
Loading