Skip to content

Commit

Permalink
ci: Adds release-please GitHub action. (#32)
Browse files Browse the repository at this point in the history
Co-authored-by: Mason Cole <[email protected]>
  • Loading branch information
dtiesling and bt-macole authored Jan 4, 2024
1 parent 72a71a8 commit c065d0b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 23 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pypi Publish
on:
release:
types:
- created
- published
env:
HATCH_INDEX_AUTH: ${{ secrets.HATCH_INDEX_AUTH }}
HATCH_INDEX_USER: ${{ secrets.HATCH_INDEX_USER }}
Expand All @@ -14,28 +14,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Extract Release Name
run: echo "RELEASE_NAME=$(echo $GITHUB_REF | sed -n 's/refs\/tags\///p')" >> $GITHUB_ENV
- name: Install hatch
run: pip install hatch
- name: Publish to Pypi
run: |
hatch version $RELEASE_NAME
hatch build
hatch publish -n
- name: Checkout Main
run: |
git fetch
git stash
git checkout main
git stash apply
- name: Add & Commit
uses: EndBug/[email protected]
with:
add: 'src/flask_muck/__init__.py'
push: origin main --force

22 changes: 22 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
branches:
- main

permissions: {}

name: release-please

jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
with:
# in order to trigger other actions such as Pypi Publish
# need to use a PAT other than the default GITHUB_TOKEN
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-type: python
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,26 @@ All non-bug-related discussions such as support or feature requests should be su

MIT licensed. See the [LICENSE](./LICENSE) file for more details.

## Contributing

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

### How should I write my commits?

This project uses [release please](https://github.com/googleapis/release-please) and [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for versioning releases.

Per [release-please-action](https://github.com/google-github-actions/release-please-action):

> The most important prefixes you should have in mind are:
>
> - `fix``: which represents bug fixes, and correlates to a SemVer patch.
> - `feat``: which represents a new feature, and correlates to a SemVer minor.
> - `feat!``:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
Any PR with `fix`, `feat`, `docs`, or a conventional commit with an `!` will trigger a release PR when merged.

Other conventional commits such as `chore`, `ci`, `test`, `refactor`, etc will not trigger a release but are encouraged to form a standard around conventional commits in the commit history.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand All @@ -124,8 +144,6 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Support

Thanks for the stars! They mean nothing but bring me immense satisfaction. Keep 'em coming.
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "Flask-Muck"
dynamic = ["version"]
name = "flask-muck"
version = "0.2.0"
authors = [
{ name="Daniel Tiesling", email="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion src/flask_muck/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .views import FlaskMuckApiView
from .callback import FlaskMuckCallback

VERSION = "0.2.0"
__version__ = "0.2.0"

0 comments on commit c065d0b

Please sign in to comment.