Skip to content

Commit f22a53f

Browse files
myronmarstonclaude
andcommitted
Improve release workflow.
Three related fixes: 1. Regenerate schema artifacts when bumping version. runtime_metadata.yaml embeds the EG version, so it must be regenerated during version bump. 2. Trigger CI on release PRs via workflow_dispatch. PRs created by GITHUB_TOKEN don't trigger pull_request workflows (GitHub prevents infinite loops). Now we explicitly trigger CI so release PRs get the required status check. 3. Disable commit signing so tagged commit lands in main. create-pull-request with sign-commits: true recreates commits via GitHub API with new SHAs, orphaning the tagged commit. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6e2a93b commit f22a53f

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
branches:
88
- main
99
pull_request:
10+
# Allows triggering CI manually or from other workflows. Used by the release workflow
11+
# to trigger CI on release PRs, since PRs created by GITHUB_TOKEN don't automatically
12+
# trigger the `pull_request` event (GitHub prevents this to avoid infinite loops).
13+
workflow_dispatch:
1014

1115
env:
1216
# It's recommended to run ElasticGraph with this option to get better performance. We want to run

.github/workflows/release.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
- name: Create pull request for the version bump
103103
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
104104
with:
105-
sign-commits: true
105+
sign-commits: false
106106
branch: release-v${{ inputs.version }}
107107
title: "Release v${{ inputs.version }}"
108108
body: |
@@ -115,6 +115,14 @@ jobs:
115115
- [ ] Confirm this version bump should be merged into [${{ github.ref_name }}](https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}) or change the base branch
116116
- [ ] Review and edit the [GitHub Draft Release](https://github.com/${{ github.repository }}/releases) (can be done after this PR is merged)
117117
118+
# PRs created using GITHUB_TOKEN don't trigger `pull_request` workflows (GitHub prevents
119+
# this to avoid infinite loops). We explicitly trigger CI here so that the release PR
120+
# gets the required `All CI Checks Passed` status check for branch protection.
121+
- name: Trigger CI on release branch
122+
run: gh workflow run ci.yaml --ref release-v${{ inputs.version }}
123+
env:
124+
GH_TOKEN: ${{ github.token }}
125+
118126
- name: Create GitHub Release
119127
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
120128
with:

config/release/Rakefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ bump_version = lambda do |version:, message:|
2929

3030
::Gem::Release::Cmds::Runner.new(:bump, ["elasticgraph-support"], opts).run
3131

32-
# We also want to commit an update to `Gemfile.lock` as part of the version bump.
32+
# We also want to commit updates to `Gemfile.lock` and schema artifacts as part of the version bump.
33+
# Schema artifacts must be regenerated because `runtime_metadata.yaml` embeds the ElasticGraph version.
3334
::Bundler.with_unbundled_env do
3435
sh "bundle install"
35-
sh "git add Gemfile.lock"
36+
sh "bundle exec rake schema_artifacts:dump"
37+
sh "git add Gemfile.lock config/schema/artifacts/ config/schema/artifacts_with_apollo/"
3638
sh "git commit --amend --no-edit"
3739
end
3840
end

0 commit comments

Comments
 (0)