Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish

on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# include git history for setuptools-scm
fetch-depth: 20
fetch-tags: true

# work around a bug of checkout
# https://github.com/actions/checkout/issues/1467
ref: ${{ github.ref }}
- name: Set up Python
uses: actions/setup-python@v3
- name: build
run: |
python -m pip install build
python -m build
- name: dump result
run: |
ls -alh dist/
find dist -name *.whl -print -exec unzip -l {} \;
find dist -name *.tar.gz -print -exec tar -ztvf {} \;
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
skip-existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}