-
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.
- Loading branch information
1 parent
7c82549
commit 9b8d4f4
Showing
2 changed files
with
78 additions
and
0 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,43 @@ | ||
# | ||
# When executed manually, this will upload to testpypi; | ||
# when executed upon a release, it will upload to pypi. | ||
# | ||
# For pypi, you need to have the PYPI_USERNAME and PYPI_PASSWORD secrets configured. | ||
# For testpypi, you'll need TESTPYPI_USERNAME and TESTPYPI_PASSWORD. | ||
# | ||
name: build & upload | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-wheel: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: build it | ||
run: | | ||
python3 -m pip install build twine | ||
python3 -m build | ||
- name: Non-release (dev) upload | ||
if: github.event_name != 'release' | ||
env: | ||
TWINE_REPOSITORY: testpypi | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} | ||
run: twine upload --verbose dist/* | ||
|
||
- name: Release upload | ||
if: github.event_name == 'release' | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: twine upload --verbose dist/* |
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,35 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- src/** | ||
- test/** | ||
|
||
pull_request: | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-13 ] | ||
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
allow-prereleases: true | ||
|
||
- name: install dependencies | ||
run: | | ||
python3 -m pip install . | ||
- name: run tests | ||
run: | | ||
python3 -m pytest |