Skip to content

Commit 67bc75e

Browse files
authored
chore: add better releasing docs (#204)
This PR adds a `Contributing.md` that has a releasing section and updates the PR description of the prepare-release workflow with instructions for how to finish the release. Additionally, it replaces the token used to creating and merging the release PR with the token we have for devtoolsbot. This should result in normal workflows getting run both on the release PR and the main branch after merging.
1 parent d761a65 commit 67bc75e

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

.github/workflows/prepare-release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ on:
44
workflow_dispatch:
55
inputs:
66
version_update_type:
7-
description: What type of version bump should be done
7+
description: What type of version bump should be done.
88
type: choice
99
options:
1010
- patch
1111
- minor
1212
- major
13+
exact_version:
14+
description: An optional exact version to bump to. If this is specified, version_update_type will be ignored.
15+
type: string
16+
required: false
1317

1418
jobs:
1519
prepare:
@@ -24,15 +28,21 @@ jobs:
2428

2529
- name: Bump version
2630
run: |
27-
echo "new-version=$(npm version ${{ github.event.inputs.version_update_type }} --no-git-tag-version)" >> $GITHUB_OUTPUT
31+
echo "new-version=$(npm version ${{ github.event.inputs.exact_version || github.event.inputs.version_update_type }} --no-git-tag-version)" >> $GITHUB_OUTPUT
2832
id: version
2933

3034
- name: Create Release PR
3135
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
3236
with:
3337
branch: release/${{ steps.version.outputs.new-version }}
3438
title: 'chore: bump version to ${{ steps.version.outputs.new-version }}'
39+
token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
3540
draft: false
36-
body: An automated PR for next release.
41+
body: |
42+
An automated PR for next release.
43+
44+
**Note**: Don't merge this manually. Instead, run the [Publish Release](${{ github.server_url }}/${{github.repository}}/actions/workflows/publish-release.yml) workflow using `release/${{ steps.version.outputs.new-version }}` as target branch.
45+
46+
This PR will be merged automatically and a new Github release will be tagged when the package is published to NPM.
3747
commit-message: 'chore: bump version to ${{ steps.version.outputs.new-version }}'
3848
labels: ignore-for-release

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Merge Pull Request
4545
uses: juliangruber/merge-pull-request-action@9234b8714dda9a08f3d1df5b2a6a3abd7b695353 # 1.3.1
4646
with:
47-
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
github-token: ${{ secrets.SVC_DEVTOOLSBOT_TOKEN }}
4848
number: ${{ steps.find-pull-request.outputs.number }}
4949
method: squash
5050

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Contributing
2+
3+
## Workflow
4+
5+
MongoDB welcomes community contributions! If you’re interested in making a contribution to the MongoDB Shell, please follow the steps below before you start writing any code:
6+
7+
1. Sign the [contributor's agreement](https://www.mongodb.com/contributor). This will allow us to review and accept contributions.
8+
1. Fork the repository on GitHub
9+
1. Create a branch with a name that briefly describes your feature
10+
1. Implement your feature or bug fix
11+
1. Add new test cases that verify your bug fix or make sure no one
12+
unintentionally breaks your feature in the future and run them with `npm test`
13+
- You can use `it.only()` instead of `it()` in mocha tests to run only a subset of tests.
14+
This can be helpful, because running the full test suite likely takes some time.
15+
1. Add comments around your new code that explain what's happening
16+
1. Commit and push your changes to your branch then submit a pull request
17+
18+
## Bugs
19+
20+
You can report new bugs by
21+
[creating a new issue](https://github.com/mongodb-js/oidc-plugin/issues).
22+
Please include as much information as possible about your environment.
23+
24+
## Releasing
25+
26+
To release a new version of this plugin, follow these steps:
27+
28+
1. Run the [Prepare Release](https://github.com/mongodb-js/oidc-plugin/actions/workflows/prepare-release.yml) workflow with the desired type of version bump (major, minor, patch) or an exact version.
29+
1. The workflow will create a new release branch and a new pull request with the changes. Review the changes and ensure everything on CI looks good.
30+
1. Run the [Publish Release](https://github.com/mongodb-js/oidc-plugin/actions/workflows/publish-release.yml) workflow from the release branch. This will publish the plugin to npm, merge the release PR, and create a new github release.

0 commit comments

Comments
 (0)