v0.1.0 #7
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
name: Package and release | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
release: | |
types: [published] | |
jobs: | |
package: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Necessary to get tags for correct versioning | |
fetch-depth: 0 | |
- uses: ./.github/actions/setup | |
- run: | | |
poetry self add "poetry-dynamic-versioning[plugin]" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- run: | | |
poetry env use 3.11 | |
poetry build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: QURI Algo packages | |
path: dist/* | |
if-no-files-found: error | |
release: | |
needs: [package] | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: QURI Algo packages | |
- name: Install Twine | |
run: python -m pip install twine | |
- name: Release to PyPI | |
run: python -m twine upload * | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.TWINE_API_TOKEN }} |