Skip to content

Commit 835673e

Browse files
Merge v1.19 into master (#1588)
2 parents 4956b57 + c72bde6 commit 835673e

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
app_id: ${{ vars.APP_ID }}
6363
private_key: ${{ secrets.APP_PRIVATE_KEY }}
6464
submodules: true
65+
fetch-depth: 0
6566

6667
- name: "Set up drivers-github-tools"
6768
uses: mongodb-labs/drivers-github-tools/setup@v2
@@ -109,20 +110,43 @@ jobs:
109110
with:
110111
version: ${{ inputs.version }}
111112
tag_message_template: 'Release ${VERSION}'
113+
# Don't push tag, we'll do that after merging up
114+
push_tag: false
112115

113116
- name: "Bump to next development release and commit"
114117
uses: mongodb-labs/drivers-github-tools/bump-version@v2
115118
with:
116119
version: ${{ inputs.version }}
117120
version_bump_script: "./bin/update-release-version.php to-next-patch-dev"
118121
commit_template: 'Back to -dev'
122+
# Don't push commit, we still need to merge up
123+
push_commit: false
124+
125+
- name: "Determine branch to merge up to"
126+
id: get-next-branch
127+
uses: alcaeus/automatic-merge-up-action/get-next-branch@main
128+
with:
129+
ref: ${{ github.ref_name }}
130+
branchNamePattern: 'v<major>.<minor>'
131+
fallbackBranch: 'master'
119132

120-
# TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created
121-
# Process is:
122-
# 1. switch to next branch (according to merge-up action)
123-
# 2. merge release branch using --strategy=ours
124-
# 3. push next branch
125-
# 4. switch back to release branch, then push
133+
- name: "Manually merge up changes"
134+
if: ${{ steps.get-next-branch.outputs.hasNextBranch }}
135+
run: |
136+
git checkout ${NEXT_BRANCH}
137+
git merge --strategy=ours ${RELEASE_BRANCH}
138+
git push origin ${NEXT_BRANCH}
139+
git checkout ${RELEASE_BRANCH}
140+
env:
141+
NEXT_BRANCH: ${{ steps.get-next-branch.outputs.branchName }}
142+
RELEASE_BRANCH: ${{ github.ref_name }}
143+
144+
- name: "Push tag and release branch"
145+
run: |
146+
git push origin ${RELEASE_BRANCH}
147+
git push origin tag ${{ inputs.version }}
148+
env:
149+
RELEASE_BRANCH: ${{ github.ref_name }}
126150

127151
- name: "Prepare release message"
128152
run: |

0 commit comments

Comments
 (0)