Generate release #22
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: Generate release | |
| on: | |
| release: | |
| types: published | |
| jobs: | |
| build_package: | |
| name: Build the package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache build artifact | |
| uses: actions/cache@v3 | |
| with: | |
| path: dist | |
| key: ${{ runner.os }}-cache-${{ github.sha }} | |
| - name: Install dependencies | |
| run: pip install build | |
| - name: Build the package | |
| run: python3 -m build | |
| publish_package: | |
| name: Publish the package | |
| runs-on: ubuntu-latest | |
| needs: build_package | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Get build artifact | |
| uses: actions/cache@v3 | |
| with: | |
| path: dist | |
| key: ${{ runner.os }}-cache-${{ github.sha }} | |
| - name: Install dependencies | |
| run: pip install -U twine packaging | |
| - name: Publish the package to PyPI | |
| env: | |
| PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| PYPI_TOKEN: hello | |
| run: TWINE_USERNAME=${{ env.PYPI_USERNAME }} TWINE_PASSWORD=${{ env.PYPI_TOKEN }} python3 -m twine upload -r pypi dist/* --verbose |