Skip to content

Commit a703a8f

Browse files
committed
Add GH workflow for PyPI publication
1 parent 7abba53 commit a703a8f

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: publish-pypi
2+
3+
on:
4+
release:
5+
types: [released]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish-job:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repo
13+
uses: actions/checkout@v6.0.3
14+
- uses: mamba-org/setup-micromamba@v3
15+
with:
16+
environment-file: environment.yml
17+
init-shell: >-
18+
bash
19+
cache-environment: false
20+
create-args: python-build twine
21+
post-cleanup: 'all'
22+
- name: Build packages
23+
shell: bash -el {0}
24+
run: |
25+
python3 -m build
26+
- name: Check build
27+
shell: bash -el {0}
28+
run: |
29+
python3 -m twine check dist/*
30+
- name: Upload to PyPI
31+
shell: bash -el {0}
32+
run: |
33+
python3 -m twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*

0 commit comments

Comments
 (0)