-
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 1 commit
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,54 @@ | ||
| name: Merge Release Tag | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'mongosh@[0-9]+.[0-9]+.[0-9]+' | ||
| workflow_dispatch: | ||
|
|
||
| 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 | ||
| id: version | ||
| run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF} | sed -n 's/refs\/tags\/mongosh@\([0-9]\+\.[0-9]\+\.[0-9]\+\)/\1/p')" >> $GITHUB_ENV | ||
gagik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Validate release version | ||
| shell: bash | ||
| run: | | ||
| if [ -z "${RELEASE_VERSION}" ]; then | ||
| echo "RELEASE_TAG is not set or is empty" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if git rev-parse "release/v$RELEASE_VERSION" >/dev/null 2>&1; then | ||
| echo "Error: Branch release/v$RELEASE_TAG already exists" | ||
|
||
| echo "If this version has already been released consider using a different one." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Create and push branch from tag | ||
| run: | | ||
| git checkout -b release/v$RELEASE_VERSION ${{ github.ref }} | ||
| git push origin release/v$RELEASE_VERSION | ||
gagik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Merge branch into main | ||
| run: | | ||
| git checkout main | ||
| git merge release/v$RELEASE_VERSION | ||
| git push origin main | ||
| git push -d origin release/v$RELEASE_VERSION | ||
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.