upload release to PyPI #50
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: upload release to PyPI | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| pypi-publish: | |
| name: upload release to PyPI | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/[email protected] | |
| - uses: actions/[email protected] | |
| with: | |
| python-version: ">=3.10" | |
| - name: Get version | |
| run: | | |
| echo "version=$(date +'%Y.%m.%d.%H.%M')" >> "$GITHUB_ENV" | |
| - name: Tag and release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| git tag $version | |
| git push origin $version | |
| pip install poetry | |
| poetry self add poetry-dynamic-versioning[plugin] | |
| poetry install --sync | |
| poetry build | |
| gh release create --generate-notes $version ./dist/* | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |