Conversation
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? |
| step "1/5" "Updating main branch..." | ||
| git checkout main | ||
| git pull upstream main | ||
|
|
There was a problem hiding this comment.
we should probably also do git fetch upstream --tags here
- 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>
There was a problem hiding this comment.
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.shto create a release branch and open a release PR after running the release CLI in dry-run mode. - Add
scripts/release-publish.shto tag the merged release commit, trigger therelease.ymlworkflow, and create a GitHub release. - Add
scripts/release-install.shpluspackage.jsonyarn 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.
| step "1/6" "Updating main branch..." | ||
| git checkout main | ||
| git pull upstream main | ||
| git fetch upstream --tags |
There was a problem hiding this comment.
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.
| # 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} | ||
| " |
There was a problem hiding this comment.
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.
| git checkout -b "$BRANCH_NAME" | ||
|
|
||
| step "5/8" "Installing dependencies and building release CLI..." | ||
| yarn |
There was a problem hiding this comment.
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.
| yarn | |
| yarn install --immutable |
| # 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" |
There was a problem hiding this comment.
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.
| # 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" |
💚 Build SucceededHistory
cc @acstll |
💚 Build Succeeded
History
cc @acstll |
Summary
This PR adds 2 scripts to automate some of the manual steps involved in the release process.
yarn release:prephelps create the release PRyarn release:publishadds the git tag and triggers the workflow, once the PR has been mergedTODO
ghas wellprepscript, 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
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/binfolder, 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:
to create the release PR, and then
to publish.