Merge pull request #21 from k8thekat/developer #19
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: | |
| branches: [ main ] | |
| release: | |
| types: [ published ] | |
| jobs: | |
| # If we push to main we will make our sdist. | |
| make-sdist: | |
| name: Make source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-source-dist | |
| path: "./**/dist/*.tar.gz" | |
| upload_pypi: | |
| # This only fires when we generate a release. | |
| if: ${{github.event.release}} | |
| runs-on: ubuntu-latest | |
| needs: [make-sdist] | |
| environment: release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| - name: Copy artifacts to .dist/ folder | |
| run: | | |
| find . -name 'artifact-*' -exec unzip '{}' \; | |
| mkdir -p dist/ | |
| find . -name '*.tar.gz' -exec mv '{}' dist/ \; | |
| find . -name '*.whl' -exec mv '{}' dist/ \; | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| name: Publish to PyPI | |