From 8cdfb99ec0cd18a70f580e370dd19652c12ccbf9 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 22 Nov 2024 18:51:28 +0100 Subject: [PATCH] chore: add better releasing docs --- .github/workflows/prepare-release.yml | 15 +++++++++++--- CONTRIBUTING.md | 30 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 42633f6..f5ee3cf 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -4,12 +4,16 @@ on: workflow_dispatch: inputs: version_update_type: - description: What type of version bump should be done + description: What type of version bump should be done. type: choice options: - patch - minor - major + exact_version: + description: An optional exact version to bump to. If this is specified, version_update_type will be ignored. + type: string + required: false jobs: prepare: @@ -24,7 +28,7 @@ jobs: - name: Bump version run: | - echo "new-version=$(npm version ${{ github.event.inputs.version_update_type }} --no-git-tag-version)" >> $GITHUB_OUTPUT + echo "new-version=$(npm version ${{ github.event.inputs.exact_version || github.event.inputs.version_update_type }} --no-git-tag-version)" >> $GITHUB_OUTPUT id: version - name: Create Release PR @@ -33,6 +37,11 @@ jobs: branch: release/${{ steps.version.outputs.new-version }} title: 'chore: bump version to ${{ steps.version.outputs.new-version }}' draft: false - body: An automated PR for next release. + body: | + An automated PR for next release. + + **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. + + This PR will be merged automatically and a new Github release will be tagged when the package is published to NPM. commit-message: 'chore: bump version to ${{ steps.version.outputs.new-version }}' labels: ignore-for-release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9e75f73 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing + +## Workflow + +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: + +1. Sign the [contributor's agreement](https://www.mongodb.com/contributor). This will allow us to review and accept contributions. +1. Fork the repository on GitHub +1. Create a branch with a name that briefly describes your feature +1. Implement your feature or bug fix +1. Add new test cases that verify your bug fix or make sure no one + unintentionally breaks your feature in the future and run them with `npm test` + - You can use `it.only()` instead of `it()` in mocha tests to run only a subset of tests. + This can be helpful, because running the full test suite likely takes some time. +1. Add comments around your new code that explain what's happening +1. Commit and push your changes to your branch then submit a pull request + +## Bugs + +You can report new bugs by +[creating a new issue](https://github.com/mongodb-js/oidc-plugin/issues). +Please include as much information as possible about your environment. + +## Releasing + +To release a new version of this plugin, follow these steps: + +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. +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. +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.