-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from k2bd/chore/add-release-actions
Update README and setup release and publication
- Loading branch information
Showing
3 changed files
with
95 additions
and
2 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,17 @@ | ||
name: Release Package to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
with: | ||
pypi_token: ${{ secrets.PYPI_PASSWORD }} |
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,46 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bump: | ||
type: choice | ||
description: How to bump the version | ||
required: true | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.BOT_ACCESS_TOKEN }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- run: python -m pip install poetry | ||
- run: poetry install --all-extras | ||
- name: Configure git | ||
run: | | ||
git config --global user.name 'Release bot' | ||
git config --global user.email '[email protected]' | ||
git push | ||
- name: bump release version and tag | ||
run: | | ||
poetry version ${{ github.event.inputs.bump }} | ||
export NEW_VERSION=v$(poetry version -s) | ||
git commit -am "Bumping to version $NEW_VERSION" | ||
git tag -a $NEW_VERSION -m $NEW_VERSION | ||
- name: prepatch to the next version | ||
run: | | ||
poetry version prepatch | ||
export NEW_VERSION=v$(poetry version -s) | ||
git commit -am "Prepatching to $NEW_VERSION" | ||
- name: Push results | ||
# See https://www.wearecogworks.com/blog/quick-guide-to-running-sub-workflows-with-github-actions/ | ||
run: | | ||
git push "https://$GITHUB_ACTOR:${{ secrets.BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" | ||
git push "https://$GITHUB_ACTOR:${{ secrets.BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --tags |
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