Merge pull request #229 from TotallyNotRobots/renovate/mcr.microsoft.… #240
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 and Publish | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| HATCH_VERSION: "1.16.2" | |
| jobs: | |
| build: | |
| permissions: | |
| contents: read | |
| name: Build distribution 📦 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Set up Python | |
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Install Hatch | |
| uses: pypa/hatch@install | |
| with: | |
| version: "${{ env.HATCH_VERSION }}" | |
| - name: Build a binary wheel and a source tarball | |
| run: hatch build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: >- | |
| Publish Python 🐍 distribution 📦 to PyPI | |
| if: github.ref_type == 'tag' | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/asyncirc | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | |
| - name: Store the (now signed) distribution packages | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| overwrite: true | |
| add-release-artifacts: | |
| if: github.ref_type == 'tag' | |
| needs: | |
| - publish-to-pypi | |
| name: >- | |
| Sign the Python 🐍 distribution 📦 with Sigstore | |
| and upload them to GitHub Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Download all the dists | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Upload release files and signatures | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 | |
| with: | |
| draft: true | |
| files: | | |
| ./dist/** |