diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f1d1560 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Bump version +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + build: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} + fetch-depth: '0' + + - uses: paulhatch/semantic-version@v5.3.0 + id: semantic_version + with: + # The prefix to use to identify tags + tag_prefix: "v" + + - name: Release + run: gh release create ${{steps.semantic_version.outuputs.version}} --notes-from-tag \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78ff53f..dfacad7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,3 +122,8 @@ git push ``` Do not hold onto your changes for too long. Commit and push frequently and create a pull request as soon as possible for backup and visibility. + +## Merging PRs + +We use a [GitHub Action](https://github.com/PaulHatch/semantic-version) to compute the version based on conventional commit messages and then +the [GitHub relase CLI](https://cli.github.com/manual/gh_release_create) to push a tag and generate release notes on merged PRs. \ No newline at end of file