-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (35 loc) · 1008 Bytes
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Build and Publish
on:
push:
env:
PYTHON_VERSION: '3.8'
jobs:
buildAndPublish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files
- name: Run Tests
run: |
pip install poetry
poetry install --with dev
. ./.venv/bin/activate
pytest .
rm -rf .venv
- name: Publish to PYPI
if: github.ref_name == 'main'
run: |
pip install poetry
poetry config virtualenvs.create false
poetry build
# basemath is already present as a package (as in math with bases), so use a slightly different name
poetry publish --skip-existing -u "__token__" --password "$PYPI_TOKEN"
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}