⬆️ Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0 in the githu… #484
This file contains 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: GH | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
release: | |
types: [released, prereleased] | |
workflow_dispatch: # allows running workflow manually from the Actions tab | |
jobs: | |
CI: | |
runs-on: ubuntu-20.04 | |
permissions: | |
id-token: write # codecov/codecov-action | |
strategy: | |
matrix: | |
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
if: matrix.python-version != '2.7' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Python 2 | |
if: matrix.python-version == '2.7' | |
run: | | |
sudo rm -f $(which python) $(which pip) | |
sudo apt-get install python2.7-dev | |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py | |
python2.7 get-pip.py | |
sudo ln -sf "$(which python2.7)" "$(dirname $(which python2.7))/python" | |
- name: Pip cache | |
uses: actions/cache@v4 | |
with: | |
save-always: true | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements/*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Pre-commit cache | |
uses: actions/cache@v4 | |
with: | |
save-always: true | |
path: ~/.cache/pre-commit | |
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-${{ hashFiles('**/requirements/ci.txt') }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pre-commit- | |
- name: Install dependencies | |
run: | | |
pip install -U pip setuptools wheel | |
make install | |
- name: Lint | |
if: matrix.python-version == 3.12 | |
run: make lint | |
- name: Test | |
run: make test | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
use_oidc: true | |
windows-smoketest: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install | |
run: | | |
pip install -U pip setuptools wheel | |
pip install . | |
- name: Test (ascii) | |
run: pipgrip -vvv --tree pipgrip | |
- name: Test (unicode) | |
env: | |
PYTHONUTF8: '1' | |
run: pipgrip -vvv --tree pipgrip | |
CD: | |
needs: [CI, windows-smoketest] | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # softprops/action-gh-release | |
id-token: write # pypa/gh-action-pypi-publish | |
issues: write # apexskier/github-release-commenter | |
pull-requests: write # apexskier/github-release-commenter | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Build | |
run: | | |
pip install -U pip setuptools wheel | |
python setup.py sdist bdist_wheel --universal | |
- name: Upload release assets | |
uses: softprops/[email protected] | |
with: | |
files: dist/* | |
- name: Publish package distributions to PyPI | |
uses: pypa/[email protected] | |
- uses: apexskier/github-release-commenter@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
comment-template: | | |
Released {release_link} |