v0.1.17.c #49
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: Publish Python 🐍 distributions 📦 to PyPI | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Print versions | |
| run: | | |
| python --version | |
| uv --version | |
| task --version | |
| # 1. Install dependencies | |
| - name: Install dependencies | |
| run: task install | |
| # 2. Build package | |
| - name: Build package | |
| run: task build | |
| # 3. Publish to PyPI | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| # 4. Create SBOM | |
| - name: Create SBOM and attach to the release | |
| run: uv run cyclonedx-py 'environment' --output-format=json --output-file=chemotools-${{ github.event.release.tag_name }}-sbom.json | |
| # 5. Upload SBOM as a release asset | |
| - name: Upload SBOM to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: chemotools-${{ github.event.release.tag_name }}-sbom.json | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |