Skip to content

Commit 9b8d4f4

Browse files
- adding workflows;
1 parent 7c82549 commit 9b8d4f4

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# When executed manually, this will upload to testpypi;
3+
# when executed upon a release, it will upload to pypi.
4+
#
5+
# For pypi, you need to have the PYPI_USERNAME and PYPI_PASSWORD secrets configured.
6+
# For testpypi, you'll need TESTPYPI_USERNAME and TESTPYPI_PASSWORD.
7+
#
8+
name: build & upload
9+
10+
on:
11+
release:
12+
types: [ published ]
13+
workflow_dispatch:
14+
15+
jobs:
16+
build-wheel:
17+
runs-on: 'ubuntu-latest'
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.11
24+
25+
- name: build it
26+
run: |
27+
python3 -m pip install build twine
28+
python3 -m build
29+
30+
- name: Non-release (dev) upload
31+
if: github.event_name != 'release'
32+
env:
33+
TWINE_REPOSITORY: testpypi
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
36+
run: twine upload --verbose dist/*
37+
38+
- name: Release upload
39+
if: github.event_name == 'release'
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
43+
run: twine upload --verbose dist/*

.github/workflows/tests.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
paths:
6+
- src/**
7+
- test/**
8+
9+
pull_request:
10+
11+
workflow_dispatch:
12+
13+
jobs:
14+
run-tests:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ ubuntu-latest, macos-13 ]
19+
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python }}
27+
allow-prereleases: true
28+
29+
- name: install dependencies
30+
run: |
31+
python3 -m pip install .
32+
33+
- name: run tests
34+
run: |
35+
python3 -m pytest

0 commit comments

Comments
 (0)