Skip to content

[Release] Automate most manual steps#9419

Open
acstll wants to merge 4 commits intoelastic:mainfrom
acstll:feat/release-automation
Open

[Release] Automate most manual steps#9419
acstll wants to merge 4 commits intoelastic:mainfrom
acstll:feat/release-automation

Conversation

@acstll
Copy link
Copy Markdown
Contributor

@acstll acstll commented Mar 2, 2026

Summary

This PR adds 2 scripts to automate some of the manual steps involved in the release process.

  • yarn release:prep helps create the release PR
  • yarn release:publish adds the git tag and triggers the workflow, once the PR has been merged

TODO

  • add a step at the very end to create the "release" in GitHub using gh as well
  • add a "dirty worktree" check before pushing in the prep script, and probably prompt the user about that to do…

Note

I used this script for the v113.1.0 release

Why are we making this change?

To save time and prevent errors.

Important

I'm happy to close this if you don't think this is a good idea or has little value

Screenshots

Screenshot 2026-02-23 at 17 22 51

Impact to users

None, internal.

QA

The one (and probably only) way to test this is to actually use it for a real release. If you're feeling adventurous, you can run the script below to get the scripts installed on your .local/bin folder, so you can run them standalone…

bash <(curl -s https://raw.githubusercontent.com/acstll/eui/feat/release-automation/scripts/release-install.sh)

then from the eui root:

release-prep.sh

to create the release PR, and then

release-publish.sh

to publish.

@acstll acstll self-assigned this Mar 2, 2026
@acstll acstll added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Mar 2, 2026
@weronikaolejniczak
Copy link
Copy Markdown
Contributor

I'm happy to close this if you don't think this is a good idea or has little value

This is absolutely a good idea and has great value, Arturo! It's a great call and I'm happy you found time to do this during support week ❤️ Is there anything I can do to push this forward? Do you need a pre-review?

Comment thread scripts/release-publish.sh Outdated
step "1/5" "Updating main branch..."
git checkout main
git pull upstream main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably also do git fetch upstream --tags here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in efb7da0

acstll and others added 3 commits April 15, 2026 13:40
- Add dirty worktree checks to prep script
- Add `git fetch upstream --tags` to publish script
- Add GitHub release creation step with changelog extraction
- Extract shared package list to variable
- Trim verbose comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows trying the release scripts locally without checking out
the branch, via curl one-liner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@acstll acstll marked this pull request as ready for review April 15, 2026 12:00
@acstll acstll requested a review from a team as a code owner April 15, 2026 12:00
Copilot AI review requested due to automatic review settings April 15, 2026 12:00
@acstll acstll changed the title [DRAFT] Automate some manual release steps [Release] Automate most manual steps Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds internal automation scripts to streamline EUI’s official release flow by reducing manual git/GitHub CLI steps.

Changes:

  • Add scripts/release-prep.sh to create a release branch and open a release PR after running the release CLI in dry-run mode.
  • Add scripts/release-publish.sh to tag the merged release commit, trigger the release.yml workflow, and create a GitHub release.
  • Add scripts/release-install.sh plus package.json yarn scripts to make running these workflows easier.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
scripts/release-prep.sh Automates pre-release PR creation steps (branching, release CLI dry run, PR creation).
scripts/release-publish.sh Automates post-merge publish steps (tagging, workflow trigger, GitHub release creation).
scripts/release-install.sh Convenience installer to place scripts into ~/.local/bin.
package.json Adds yarn release:prep and yarn release:publish script entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +46 to +49
step "1/6" "Updating main branch..."
git checkout main
git pull upstream main
git fetch upstream --tags
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script checks out/pulls main and creates a tag, but it doesn't proactively bail if the working tree is dirty. With set -e, git checkout main can fail in a confusing way (or later steps may operate on an unexpected state). Add an explicit git status --porcelain dirty-worktree check (similar to release-prep.sh) before the checkout/pull/tag steps.

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +93
# Extract changelog section for this version
changelog_file=$(ls -t "${pkg_dir}"/changelogs/CHANGELOG_*.md 2>/dev/null | head -1)
if [[ -n "$changelog_file" ]]; then
escaped_version="${new_version//./\\.}"
changelog_section=$(awk "/^## \[\`v${escaped_version}\`\]/{found=1; next} /^## \[/{if(found) exit} found" "$changelog_file")
if [[ -n "$changelog_section" ]]; then
RELEASE_BODY="${RELEASE_BODY}### \`${pkg_name}\` [v${new_version}](https://github.com/elastic/eui/blob/main/${changelog_file})
${changelog_section}
"
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog extraction currently relies on ls -t .../CHANGELOG_*.md | head -1 and then reads the changelog from the current working tree (after pulling main). This can select the wrong changelog file (mtime-based) and can also mismatch the requested MERGE_SHA if a SHA other than current main HEAD is provided. Prefer locating the changelog file that actually contains the v${new_version} header (e.g., search all CHANGELOG_*.md files) and read it from git show ${MERGE_SHA}:<path>; also consider linking to the tag/commit instead of blob/main so notes match the published release.

Copilot uses AI. Check for mistakes.
Comment thread scripts/release-prep.sh
git checkout -b "$BRANCH_NAME"

step "5/8" "Installing dependencies and building release CLI..."
yarn
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo’s CI/release workflows use yarn install --immutable (Yarn 4) to ensure installs don’t modify the lockfile or create unexpected changes. Using plain yarn here can introduce uncommitted changes (e.g. lockfile/install state) and cause the later dirty-worktree prompt to trigger for unrelated reasons. Consider switching this to yarn install --immutable (and any other flags the repo standardizes on) to keep the release branch clean and reproducible.

Suggested change
yarn
yarn install --immutable

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +12
# Usage: bash <(curl -s https://raw.githubusercontent.com/acstll/eui/feat/release-automation/scripts/release-install.sh)
#

set -euo pipefail

BRANCH="feat/release-automation"
BASE_URL="https://raw.githubusercontent.com/acstll/eui/${BRANCH}/scripts"
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release-install.sh is hardcoded to download scripts from a personal fork/branch (acstll/eui + feat/release-automation). Once this PR is merged, that URL/branch may not exist and the installer will break. Consider switching to https://raw.githubusercontent.com/elastic/eui/main/scripts (or dynamically deriving the repo/branch via args/env vars) so the install script keeps working long-term.

Suggested change
# Usage: bash <(curl -s https://raw.githubusercontent.com/acstll/eui/feat/release-automation/scripts/release-install.sh)
#
set -euo pipefail
BRANCH="feat/release-automation"
BASE_URL="https://raw.githubusercontent.com/acstll/eui/${BRANCH}/scripts"
# Usage: bash <(curl -s https://raw.githubusercontent.com/elastic/eui/main/scripts/release-install.sh)
#
set -euo pipefail
REPO_OWNER="${REPO_OWNER:-elastic}"
REPO_NAME="${REPO_NAME:-eui}"
BRANCH="${BRANCH:-main}"
BASE_URL="https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${BRANCH}/scripts"

Copilot uses AI. Check for mistakes.
@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @acstll

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @acstll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants