Make releases #1
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: Make releases | |
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.[0-9]+ | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| branches: | |
| - pypi-publishing # TODO for testing only | |
| create: | |
| tags: | |
| - v[0-9]+.[0-9]+ | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| jobs: | |
| build: | |
| name: Build distribution package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Install pypa/build | |
| run: python3 -m pip install build --user | |
| - name: Build a binary wheel and a source tarball | |
| run: python3 -m build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| name: Publish to PyPI | |
| # TODO temporarily disabled | |
| #if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/khard | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |