Skip to content

Commit

Permalink
add publish
Browse files Browse the repository at this point in the history
  • Loading branch information
moskomule committed Feb 1, 2023
1 parent 52dc2a1 commit aa86c2b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
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

on: [ "push" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: build
run: |
pip install hatch
hatch build
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ extra-dependencies = [
"mkdocs-material"
]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean --strict"
build = "mkdocs build --clean --strict"

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

0 comments on commit aa86c2b

Please sign in to comment.