v3.1.1 #16
Workflow file for this run
This file contains hidden or 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: Publish package | |
| on: | |
| release: | |
| types: [published, edited] | |
| jobs: | |
| build-and-publish-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Load cached Poetry installation | |
| uses: actions/cache@v5 | |
| with: | |
| # This path assumes the workflow is run on an ubuntu runner | |
| path: ~/.local | |
| key: key-poetry-0 | |
| - uses: snok/install-poetry@v1 | |
| - name: Publish package | |
| shell: bash | |
| run: | | |
| poetry config repositories.custom 'https://test.pypi.org/legacy/' | |
| poetry config pypi-token.custom ${{ secrets.TEST_PYPI_TOKEN }} | |
| poetry publish --build --no-interaction --repository custom | |
| build-and-publish: | |
| needs: build-and-publish-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Load cached Poetry installation | |
| uses: actions/cache@v5 | |
| with: | |
| # This path assumes the workflow is run on an ubuntu runner | |
| path: ~/.local | |
| key: key-poetry-0 | |
| - uses: snok/install-poetry@v1 | |
| - name: Publish package | |
| shell: bash | |
| run: | | |
| echo "Using default repository (PyPi)" | |
| poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
| poetry publish --build --no-interaction |