Merge pull request #8 from qiqb-osaka/feature-riquconfig #15
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: | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
poetry self add "poetry-dynamic-versioning[plugin]" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- uses: actions/checkout@v3 | |
with: | |
# Necessary to get tags for correct versioning | |
fetch-depth: 0 | |
- run: | | |
poetry build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: QURI Parts riqu 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 Parts riqu 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 }} |