name: Packaging on: push: release: types: [published] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: 3.9 - name: Install dependencies run: python -m pip install build - name: Create packages run: python -m build . - uses: actions/upload-artifact@v2 with: name: dist path: dist - name: Publish package if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master with: user: __token__ password: ${{ secrets.pypi_password }} - name: Create Release Notes if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') uses: actions/github-script@v4.0.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | await github.request(`POST /repos/${{ github.repository }}/releases`, { tag_name: "${{ github.ref }}", generate_release_notes: true });