1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
name: Release
on:
push:
tags:
- "*.*.*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
default-python: "3.13"
minimum-supported-python: "3.9"
jobs:
pypi-publish:
name: Publish pipx to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/pipx
permissions:
id-token: write
steps:
- name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v6
with:
ref: "${{ github.ref_name }}"
- name: Set up Python ${{ env.default-python }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.default-python }}
cache: "pip"
- name: Build sdist and wheel
run: |
pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
create-release:
name: Create a release on GitHub's UI
needs: pypi-publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
tag_name: "${{ github.ref_name }}"
upload-zipapp:
name: Upload zipapp to GitHub Release
needs: create-release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v6
with:
ref: "${{ github.ref_name }}"
- name: Set up Python ${{ env.minimum-supported-python }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.minimum-supported-python }}
cache: "pip"
- name: Install tox
run: pip install tox
- name: Build zipapp
run: tox run -e zipapp
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: pipx.pyz
tag_name: "${{ github.ref_name }}"
|