-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds workflows for GitHub actions: - draft-release-notes.yml - release.yml Renames `build_test.yml` as `build-test.yml`. Updates `build-test.yml` to execute on dispatch. Updates developer docs with 'releases' info. Adds hypo profile for CI Also updates `.pre-commit-config.yml` with check-yaml and flake8 pre-commits.
- Loading branch information
Showing
8 changed files
with
147 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name-template: 'v$NEXT_PATCH_VERSION 🎈' | ||
tag-template: 'v$NEXT_PATCH_VERSION' | ||
template: | | ||
# What's Changed | ||
$CHANGES | ||
categories: | ||
- title: 'New Features' | ||
label: 'enhancement' | ||
- title: 'Deprecation' | ||
label: 'deprecation' | ||
- title: 'Bug Fixes' | ||
label: 'bug' | ||
- title: 'Documentation' | ||
label: 'documentation' | ||
- title: 'Maintenance' | ||
label: 'maintenance' | ||
- title: 'Testing' | ||
label: 'tests' | ||
- title: 'Under the Bonnet' | ||
label: 'code improvement' | ||
- title: 'Continuous Integration' | ||
label: 'CI' |
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,16 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
# Updates next release notes on any push to master. Label a PR to categorize it | ||
# in accordance with .github/release_drafter.yml. | ||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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,54 @@ | ||
# Workflow to upload a Python Package using Twine when a release is created | ||
name: Release to PyPI | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TEST_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
# Verify can install from Test PyPI and import package | ||
- name: Verify from Test PyPI | ||
run: | | ||
pip install --extra-index-url https://test.pypi.org/simple market_prices | ||
python -c 'import market_prices;print(market_prices.__version__)' | ||
pip uninstall -y market_prices | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
# Verify can install from PyPI and import package | ||
- name: Verify from PyPI | ||
run: | | ||
pip install market_prices | ||
python -c 'import market_prices;print(market_prices.__version__)' |
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,29 @@ | ||
# Releases | ||
|
||
## Versioning | ||
`market_prices` follows [Semantic Versioning](https://semver.org/). Releases should versioned as "v\<MAJOR>.\<MINOR>.\<PATCH>", for example: | ||
* "v0.8.3" | ||
* *v1.12.3" | ||
* *v2.4.12" | ||
|
||
## Draft release notes | ||
Draft release notes for the next release should have been prepared by the [`draft-release-notes.yml` workflow](https://github.com/maread99/market_prices/blob/master/.github/workflows/draft-release-notes.yml). This uses the [Release Drafter action](https://github.com/marketplace/actions/release-drafter). | ||
|
||
The latest draft should be at the top of the [releases page](https://github.com/maread99/market_prices/releases). | ||
|
||
## Release workflow | ||
|
||
### Last pre-release commit | ||
* The last pre-release commit (or a prior commit) should include updating `market_prices.__init__.__version__` with the new version string. | ||
* The last pre-release commit can optionally be tagged with the new version string. | ||
|
||
### Cut a release | ||
On publishing a release via GitHub the [`release.yml` workflow](https://github.com/maread99/market_prices/blob/master/.github/workflows/release.yml) will upload the distrubtion files to PyPI. | ||
|
||
At the GitHub [releases page](https://github.com/maread99/market_prices/releases): | ||
* The draft release notes should already be at the top of the page. Click the 'Draft a new release' button. | ||
* Tag the release. Either choose the last commit's tag (if it was added) or create a new tag with the version string (this new tag will be attached to last commit). | ||
* Make sure target is selected as 'Master'. | ||
* Revise the draft release notes as requried. | ||
* If the release includes new features, select the checkbox for 'Create a discussion for this release' (otherwise leave unchecked). | ||
* Click the 'Publish Release' button. |
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