mirror of
https://github.com/atuinsh/atuin.git
synced 2026-10-16 04:26:53 +02:00
ci: land pull requests with /merge
This commit is contained in:
1 parent
6a2f44956d
commit
d109272988
4 files changed
+58
-25
No files matched your search
@@ -207,9 +207,10 @@ gh pr create \
|
||||
--draft
|
||||
```
|
||||
|
||||
Show the PR URL to the user. Tell the user to go review and merge the PR.
|
||||
Show the PR URL to the user. Tell the user to go review the PR, mark it ready,
|
||||
and comment `/merge` on it.
|
||||
|
||||
When the user reports the PR is merged, proceed to the next step.
|
||||
When the PR shows as merged, proceed to the next step.
|
||||
|
||||
---
|
||||
|
||||
@@ -233,9 +234,10 @@ For each approved PR:
|
||||
2. **Checkpoint:** Show the PR number and title and ask the user to confirm this
|
||||
specific merge. Step 2.5 approved the *timing*; this confirms merging *now*.
|
||||
|
||||
3. Merge:
|
||||
3. Merge, then wait until the PR shows as merged:
|
||||
```bash
|
||||
gh pr merge <N> --repo atuinsh/atuin --squash
|
||||
gh pr comment <N> --repo atuinsh/atuin --body /merge
|
||||
gh pr view <N> --repo atuinsh/atuin --json state --jq .state # until MERGED
|
||||
```
|
||||
|
||||
These commits land in the tag but are absent from the changelog generated in
|
||||
@@ -308,7 +310,7 @@ live while the release it points at is still building.
|
||||
|
||||
5. Merge each PR the user confirms:
|
||||
```bash
|
||||
gh pr merge <N> --repo atuinsh/atuin --squash
|
||||
gh pr comment <N> --repo atuinsh/atuin --body /merge
|
||||
```
|
||||
|
||||
Merging a `docs/` change here fires `trigger-docs-deploy.yml` and the docs go
|
||||
|
||||
@@ -445,13 +445,3 @@ steps:
|
||||
- source .buildkite/scripts/lib.sh
|
||||
- 'section ":inbox_tray: Installer via bash" .buildkite/scripts/test-installer.sh bash'
|
||||
- 'section ":inbox_tray: Installer via zsh" .buildkite/scripts/test-installer.sh zsh'
|
||||
|
||||
# Tells hub, which keeps atuin's history in its monorepo, that main moved. The
|
||||
# build it triggers takes no input from this one.
|
||||
- label: ":arrows_counterclockwise: Sync to hub"
|
||||
key: sync-to-hub
|
||||
if: *main-only
|
||||
trigger: subtree-sync
|
||||
async: true
|
||||
build:
|
||||
branch: main
|
||||
@@ -2,13 +2,14 @@ name: Beta Release
|
||||
|
||||
# Automated daily beta release. Follows the same steps as the /release skill's
|
||||
# prerelease path: bump the workspace version, refresh the running
|
||||
# `## [unreleased]` changelog section, commit, then tag. The tag push triggers
|
||||
# release.yml. Prereleases are not published to crates.io.
|
||||
# `## [unreleased]` changelog section, open a pull request and `/merge` it, then
|
||||
# tag the commit it lands as. The tag push triggers release.yml. Prereleases are
|
||||
# not published to crates.io.
|
||||
#
|
||||
# Requires a `RELEASE_TOKEN` secret: a PAT belonging to the atuin-bot user
|
||||
# with contents: write on this repo. The default GITHUB_TOKEN cannot be used:
|
||||
# tags pushed with it do not trigger other workflows, so release.yml would
|
||||
# never run.
|
||||
# with contents: write and pull requests: write on this repo. The default
|
||||
# GITHUB_TOKEN cannot be used: tags pushed with it do not trigger other
|
||||
# workflows, so release.yml would never run.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -86,6 +87,8 @@ jobs:
|
||||
needs: gate
|
||||
if: needs.gate.outputs.go == 'true'
|
||||
runs-on: depot-ubuntu-24.04
|
||||
outputs:
|
||||
pull: ${{ steps.pull.outputs.url }}
|
||||
env:
|
||||
OLD_VERSION: ${{ needs.gate.outputs.old-version }}
|
||||
NEW_VERSION: ${{ needs.gate.outputs.new-version }}
|
||||
@@ -136,15 +139,53 @@ jobs:
|
||||
tail -n "+$first" /tmp/stripped.md
|
||||
} > CHANGELOG.md
|
||||
|
||||
- name: Commit, tag, and push
|
||||
- name: Commit, push, and /merge
|
||||
id: pull
|
||||
env:
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
run: |
|
||||
git config user.name "atuin-bot"
|
||||
git config user.email "engineering@atuin.sh"
|
||||
git switch -c "$NEW_VERSION"
|
||||
git add -A
|
||||
git commit -m "chore(release): prepare for release $NEW_VERSION"
|
||||
git tag "v$NEW_VERSION"
|
||||
git push --atomic \
|
||||
git push \
|
||||
"https://atuin-bot:${RELEASE_TOKEN}@github.com/${{ github.repository }}.git" \
|
||||
"HEAD:refs/heads/main" "refs/tags/v$NEW_VERSION"
|
||||
"HEAD:refs/heads/$NEW_VERSION"
|
||||
url=$(gh pr create --repo "${{ github.repository }}" --base main --head "$NEW_VERSION" \
|
||||
--title "chore(release): prepare for release $NEW_VERSION" --body "")
|
||||
gh pr comment "$url" --body /merge
|
||||
echo "url=$url" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Waits on a free runner: a /merge takes a while to show the pull request merged.
|
||||
tag:
|
||||
needs: [gate, release]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 300
|
||||
env:
|
||||
NEW_VERSION: ${{ needs.gate.outputs.new-version }}
|
||||
PULL: ${{ needs.release.outputs.pull }}
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
steps:
|
||||
- name: Wait for the release to land
|
||||
run: |
|
||||
while state=$(gh pr view "$PULL" --json state --jq .state); [ "$state" != MERGED ]; do
|
||||
if [ "$state" = CLOSED ]; then
|
||||
echo "::error::$PULL was closed without landing"
|
||||
exit 1
|
||||
fi
|
||||
sleep 60
|
||||
done
|
||||
|
||||
- name: Tag
|
||||
run: |
|
||||
sha=$(gh pr view "$PULL" --json headRefOid --jq .headRefOid)
|
||||
git init -q tag
|
||||
cd tag
|
||||
git fetch -q --depth=1 "https://github.com/${{ github.repository }}.git" "$sha"
|
||||
git tag "v$NEW_VERSION" FETCH_HEAD
|
||||
git push \
|
||||
"https://atuin-bot:${RELEASE_TOKEN}@github.com/${{ github.repository }}.git" \
|
||||
"refs/tags/v$NEW_VERSION"
|
||||
+1
-1
@@ -62,7 +62,7 @@ filter_unconventional = true
|
||||
split_commits = false
|
||||
# regex for preprocessing the commit messages
|
||||
commit_preprocessors = [
|
||||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" }, # replace issue numbers
|
||||
{ pattern = '\((\w+\s)?(?:atuinsh/atuin)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" }, # replace issue numbers
|
||||
]
|
||||
# regex for parsing and grouping commits
|
||||
commit_parsers = [
|
||||
|
||||
Reference in new issue
Block a user