specify version explicitly #32
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: build | |
| on: | |
| push: | |
| tags: | |
| - "v?[0-9]+.[0-9]+.[0-9]+" | |
| - "v?[0-9]+.[0-9]+.[0-9]+-?rc[0-9]+" | |
| - "v?[0-9]+.[0-9]+.[0-9]+-?[ab][0-9]+" | |
| - "v?[0-9]+.[0-9]+.[0-9]+.post[0-9]+" | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| build: | |
| name: Build package | |
| uses: ./.github/workflows/_build-package.yml | |
| with: | |
| cache-package: true | |
| upload-package: true | |
| test-files: true | |
| test-imports: true | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Prepare tag | |
| run: | | |
| TAG=${GITHUB_REF#refs/*/} | |
| echo "PROLIF_VERSION=${TAG#v}" >> $GITHUB_ENV | |
| echo "Prepared version ${TAG#v} for publishing" | |
| - name: Retrieve cached package | |
| uses: actions/cache/restore@v3 | |
| id: cache-prolif | |
| with: | |
| path: | | |
| dist/prolif-${PROLIF_VERSION}*.whl | |
| dist/prolif-${PROLIF_VERSION}*.tar.gz | |
| key: prolif-${{ runner.os }}-${{ github.sha }} | |
| fail-on-cache-miss: true | |
| - name: List output | |
| run: | | |
| ls -lah dist/* | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_TOKEN }} |