Merge pull request #274 from minrk/fix-list-images #74
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
| # This is a GitHub workflow defining a set of jobs with a set of steps. | |
| # ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
| # | |
| name: Release | |
| # Always tests wheel building, but only publish to PyPI on pushed tags. | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - ".github/workflows/*.yaml" | |
| - "!.github/workflows/release.yaml" | |
| push: | |
| paths-ignore: | |
| - ".github/workflows/*.yaml" | |
| - "!.github/workflows/release.yaml" | |
| branches-ignore: | |
| - "dependabot/**" | |
| - "pre-commit-ci-update-config" | |
| tags: | |
| - "**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-release: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.13" | |
| - name: install build requirements | |
| run: | | |
| pip install --upgrade pip | |
| pip install build | |
| pip list --format=freeze | |
| - name: build release | |
| run: | | |
| python -m build --sdist --wheel . | |
| ls -l dist | |
| # ref: https://github.com/actions/upload-artifact#readme | |
| - name: upload dists | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: ${{ github.repository.name }}-dist | |
| path: dist/ | |
| pypi-publish: | |
| runs-on: ubuntu-24.04 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| environment: | |
| name: release | |
| needs: | |
| - build-release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Get release artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: ${{ github.repository.name }}-dist | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1 |