try this structure #17
Workflow file for this run
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
on: | |
push: | |
branches: | |
- master | |
- maint/* | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- master | |
- maint/* | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3 | |
- run: pip install --upgrade build twine | |
- name: Build sdist and wheel | |
run: python -m build | |
- run: twine check dist/* | |
- name: Upload sdist and wheel artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
- name: Build git archive | |
run: mkdir archive && git archive -v -o archive/archive.tgz HEAD | |
- name: Upload git archive artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: archive | |
path: archive/ | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |