Skip to content

Commit

Permalink
Adds pypi publishing job
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiesling committed Nov 19, 2023
1 parent 95a16dc commit 812f9f2
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pypi Publish

on:
release:
types:
- created

jobs:
publish:
name: Pypi Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v1
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 -r test -n
- name: Commit new version
run: |
git checkout main
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update version number to $RELEASE_NAME."
git push
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
python-version: 3.9
- run: pip install poetry
- run: poetry install --with dev
- run: poetry run mypy flask_muck/
- run: poetry run mypy src/
- run: poetry run pytest --cov=flask_muck


21 changes: 17 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["hatchling", "Flask", "sqlalchemy"]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "flask_muck"
version = "0.0.1"
name = "Flask-Muck"
dynamic = ["version"]
authors = [
{ name="Daniel Tiesling", email="[email protected]" },
]
Expand All @@ -21,6 +21,18 @@ classifiers = [
"Homepage" = "https://github.com/dtiesling/flask-muck"

[tool]
[tool.hatch.version]
path = "src/flask_muck/__init__.py"

[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/examples",
]

[tool.hatch.build.targets.wheel]
packages = ["src/flask_muck"]

[tool.poetry]
name = "flask-muck"
description = "Batteries included framework for generating RESTful apis using Flask and SqlAlchemy."
Expand All @@ -47,7 +59,7 @@ coverage = "^7.3.2"
pytest-cov = "^4.1.0"

[tool.mypy]
packages = "flask_muck"
packages = "src"
strict = true
disallow_untyped_calls = false
warn_return_any = false
Expand All @@ -56,6 +68,7 @@ disallow_any_generics = false
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test*.py"
pythonpath = ["src"]

[tool.coverage.run]
branch = true
Expand Down
2 changes: 2 additions & 0 deletions flask_muck/__init__.py → src/flask_muck/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .views import MuckApiView
from .callback import MuckCallback

VERSION = "0.0.2rc1"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 812f9f2

Please sign in to comment.