|
62 | 62 | app_id: ${{ vars.APP_ID }}
|
63 | 63 | private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
64 | 64 | submodules: true
|
| 65 | + fetch-depth: 0 |
65 | 66 |
|
66 | 67 | - name: "Set up drivers-github-tools"
|
67 | 68 | uses: mongodb-labs/drivers-github-tools/setup@v2
|
@@ -109,20 +110,43 @@ jobs:
|
109 | 110 | with:
|
110 | 111 | version: ${{ inputs.version }}
|
111 | 112 | tag_message_template: 'Release ${VERSION}'
|
| 113 | + # Don't push tag, we'll do that after merging up |
| 114 | + push_tag: false |
112 | 115 |
|
113 | 116 | - name: "Bump to next development release and commit"
|
114 | 117 | uses: mongodb-labs/drivers-github-tools/bump-version@v2
|
115 | 118 | with:
|
116 | 119 | version: ${{ inputs.version }}
|
117 | 120 | version_bump_script: "./bin/update-release-version.php to-next-patch-dev"
|
118 | 121 | 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' |
119 | 132 |
|
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 }} |
126 | 150 |
|
127 | 151 | - name: "Prepare release message"
|
128 | 152 | run: |
|
|
0 commit comments