Skip to content
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

Configure Semantic Release #286

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Description

<!-- Thanks for contributing to betterproto! Add a thorough explanation of what your changes do below this line: -->

## Checklist

- [ ] This PR targets the `rc` branch (**not** `master`).
- [ ] [If this should release a new version to PyPI when merged] The title of the PR follows the [Angular Conventional Commit](https://www.conventionalcommits.org/) syntax (`feat:` or `fix:`, with `BREAKING CHANGE:` in the commit message body if appropriate), and clearly describes the fix or feature.
- [ ] Documentation is updated (`README.md` and docstrings).
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install poetry
run: python -m pip install poetry
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build package
run: poetry build
- name: Publish package to PyPI
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.pytest_cache
.python-version
build/
node_modules/
tests/output_*
**/__pycache__
dist
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,16 @@ protoc \
- [x] Automate running tests
- [ ] Cleanup!


## Release

New versions are versioned and released using [Semantic Release](https://github.com/semantic-release/semantic-release). When new commits
using the Angular Conventional Commits syntax land on `master` or `rc`, those commits are used to determine what new version to release.

All Pull Requests must target the `rc` branch; when merged into `rc` they will publish new release candidate (`rc`) versions to PyPI
automatically. When maintainers want to publish a new full release, they simply merge `rc` into `master`. This flow ensures that features
and fixes are published quickly and continuously rather than awaiting a manual release process.

## Community

Join us on [Slack](https://join.slack.com/t/betterproto/shared_invite/zt-f0n0uolx-iN8gBNrkPxtKHTLpG3o1OQ)!
Expand Down
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "python-betterproto-semantic-release",
"version": "1.0.0",
"description": "Encapsulate dependencies needed to use semantic-release",
"dependencies": {
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/gitlab": "^6.0.4",
"conventional-changelog-eslint": "^3.0.8",
"semantic-release": "^17.1.1"
},
"release": {
"branches": [
"master",
{
"name": "rc",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "angular"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "poetry version ${nextRelease.version}"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"pyproject.toml"
],
"message": "Release v${nextRelease.version} [skip ci]"
}
]
],
"repositoryUrl": "ssh://[email protected]/danielgtaylor/python-betterproto.git"
}
}
Loading