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
| # vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab: | |
| name: Create a release and deploy to PyPi | |
| on: | |
| push: | |
| tags: | |
| - v*.*.* | |
| - v*.*.*.dev* | |
| - v*.*.*.post* | |
| jobs: | |
| build: | |
| name: Build wheel | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| - run: python -m pip install build | |
| - run: python -m build . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: package | |
| path: dist/*.* | |
| merge-into-stable: | |
| name: Update stable branch to point to this release | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| if: "!contains(github.ref, 'dev')" | |
| permissions: write-all | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: stable | |
| - run: | | |
| TAG="${{github.ref}}" # /ref/tags/v0.0.0 | |
| git merge "${TAG:10}" | |
| git push | |
| deploy: | |
| name: Upload built wheel and source package to PyPi | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/flickrhistory | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| release: | |
| name: Create a new release | |
| runs-on: ubuntu-latest | |
| needs: [deploy] | |
| if: "!contains(github.ref, 'dev')" | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| path: dist/ | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| prerelease: | |
| name: Create a new pre-release | |
| runs-on: ubuntu-latest | |
| needs: [deploy] | |
| if: contains(github.ref, 'dev') | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| path: dist/ | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| prerelease: true |