bump version #21
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python package | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ '*' ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.8" # EOL: 2024-10 | |
- "3.9" # EOL: 2025-10 | |
- "3.10" # EOL: 2026-10 | |
- "3.11" # EOL: 2027-10 | |
- "3.12" # EOL: 2028-10 | |
#- "3.13" # REL: 2024-10-01 | |
- "system" | |
# see supported python release schedule at https://devguide.python.org/versions/ | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: getargv/getargv | |
path: getargv | |
token: ${{ secrets.GH_PAT }} | |
- name: Build libgetargv | |
run: make install_dylib | |
working-directory: getargv | |
- uses: actions/checkout@v3 | |
with: | |
path: getargv.py | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
if: ${{ matrix.python-version != 'system' }} | |
with: | |
python-version: ${{ matrix.python-version }} | |
check-latest: true | |
- name: Upgrade pip & Install deps | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install build pyright | |
- name: Build | |
run: | | |
python3 -m build | |
python3 -m pip install dist/getargv-*.tar.gz | |
working-directory: getargv.py | |
- name: Test | |
run: python3 tests/testgetargv.py | |
working-directory: getargv.py | |
- name: Types Test | |
run: pyright --verifytypes getargv | |
working-directory: getargv.py | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }}.zip | |
path: | | |
getargv.py/dist/*.whl | |
getargv.py/dist/*.tar.gz | |
release: | |
if: ${{ github.ref_type == 'tag' }} | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/*.zip/* | |
name: ${{ github.ref_name }} | |
pypi-publish: | |
# hopefully this dep is enough to only run on release | |
needs: [ release ] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/getargv/ | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
- run: mv *.zip/dist ./ | |
- uses: pypa/gh-action-pypi-publish@release/v1 |