-
Notifications
You must be signed in to change notification settings - Fork 84
chore(ci): add automatic merging of the release tag MONGOSH-2018 #2379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a2ad8b
chore(ci): add automatic merging of the release tag
gagik 539413b
refactor: use a GitHub actions and a more permissive regex
gagik 21963c2
docs: reword release process check
gagik 8cedbec
fix: use stricter tag, use action for validation and rename to packag…
gagik 6525369
fix: simplify the workflow
gagik d62c756
chore: explicitly define release candidate case
gagik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Merge Release Tag | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'mongosh@[0-9]+.[0-9]+.[0-9]+*' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: none # We use the github app to checkout and push changes | ||
|
|
||
| jobs: | ||
| merge-release-tag: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main | ||
|
||
| id: app-token | ||
| with: | ||
| app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} | ||
| private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
gagik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fetch-depth: "0" | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
|
||
| - name: Extract version from tag | ||
| uses: actions-ecosystem/action-regex-match@d50fd2e7a37d0e617aea3d7ada663bd56862b9cc | ||
| id: version-match | ||
| with: | ||
| text: ${{ github.ref }} | ||
| regex: 'refs/tags/mongosh@([0-9]+\.[0-9]+\.[0-9]+.*)' | ||
|
|
||
| - uses: actions/github-script@v7 | ||
| if: steps.version-match.outputs.group1 == '' | ||
| with: | ||
| script: | | ||
| core.setFailed('Could not extract version from tag: ${{ github.ref }}'); | ||
|
|
||
| - name: Merge release tag into main | ||
| run: | | ||
| git checkout -b package-release/v${{ steps.version-match.outputs.group1 }} ${{ github.ref }} | ||
| git checkout main | ||
| git merge package-release/v${{ steps.version-match.outputs.group1 }} | ||
| git push origin main | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ Execute the following steps to publish a new release: | |
| ``` | ||
| Follow the instructions and verify the inferred release version is correct. | ||
| 7. Wait for Evergreen to finish the publication stage. | ||
| 8. The previous step will have pushed tags for the npm publishes. Check out the tag for `mongosh@<version>` (not `v<version>`), create a branch for it, push that branch and open a PR with it. Then immediately merge that branch **using the `git merge` CLI command into main** and push to main. **NEVER** use the Github PR merge functionality, since that would squash the commit and give it a new commit hash that is different from the one in the tag. | ||
| 8. Ensure that the version bump was automatically merged into main and that it is synced up with the `[email protected]` tag. | ||
| 9. Close the Jira ticket for the release, post an update in the `#mongosh` Slack channel and ping the docs team. | ||
|
|
||
| ### Branches and Tags | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is a regexp, in which case
+*would be equivalent to just*There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and, as Nikola suggested above, shouldn't it be
then?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's GitHub regex-esque pattern: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
I think the idea is to allow
-rc0..though if it's just this we can also doThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how escapes would work but GitHub Docs themselves don't use them and use i.e
v[12].[0-9]+.[0-9]+