-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update release automation scripts 4.x (#3824)
- Loading branch information
Showing
4 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,38 @@ | ||
on: | ||
push: | ||
branches: [4.x] | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
id-token: write | ||
|
||
name: release-4x | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: release | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: node | ||
package-name: mongodb | ||
# Example: chore(main): release 5.7.0 [skip-ci] | ||
# ${scope} - parenthesis included, base branch name | ||
pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]' | ||
pull-request-header: 'Please run the release_notes action before releasing to generate release highlights' | ||
changelog-path: HISTORY.md | ||
default-branch: 4.x | ||
|
||
# If release-please created a release, publish to npm | ||
- if: ${{ steps.release.outputs.release_created }} | ||
uses: actions/checkout@v3 | ||
- if: ${{ steps.release.outputs.release_created }} | ||
name: actions/setup | ||
uses: ./.github/actions/setup | ||
- if: ${{ steps.release.outputs.release_created }} | ||
run: npm publish --provenance --tag=4x | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains 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,48 @@ | ||
name: release_notes | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releasePr: | ||
description: 'Enter release PR number' | ||
required: true | ||
type: number | ||
|
||
jobs: | ||
release_notes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: actions/setup | ||
uses: ./.github/actions/setup | ||
|
||
# See: https://github.com/googleapis/release-please/issues/1274 | ||
|
||
# Get the PRs that are in this release | ||
# Outputs a list of comma seperated PR numbers, parsed from HISTORY.md | ||
- id: pr_list | ||
run: node .github/scripts/pr_list.mjs | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
# From the list of PRs, gather the highlight sections of the PR body | ||
# output JSON with "highlights" key (to preserve newlines) | ||
- id: highlights | ||
run: node .github/scripts/highlights.mjs | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
PR_LIST: ${{ steps.pr_list.outputs.pr_list }} | ||
|
||
# The combined output is available | ||
- id: release_notes | ||
run: node .github/scripts/release_notes.mjs | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
HIGHLIGHTS: ${{ steps.highlights.outputs.highlights }} | ||
|
||
# Update the release PR body | ||
- run: gh pr edit ${{ inputs.releasePr }} --body-file ${{ steps.release_notes.outputs.release_notes_path }} | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |