Skip to content

Commit

Permalink
feat(ci): build for Python >= 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Oct 24, 2023
1 parent 3839831 commit 3e9615a
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,63 @@ jobs:
test:
uses: ./.github/workflows/pytest.yml

release:
package:
runs-on: ubuntu-latest
environment: release
needs: test
permissions:
# https://github.com/softprops/action-gh-release#permissions
contents: write
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
id-token: write

strategy:
matrix:
version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Setup Python ${{ matrix.version }}
uses: actions/setup-python@v4
with:
python-version-file: .github/workflows/.python-version
python-version: ${{ matrix.version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"

- name: Install build dependencies
run: pip install build

- name: Build package
- name: Build artifact for ${{ matrix.version }}
run: python -m build

- name: Upload artifact for ${{ matrix.version }}
uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist/**

release:
runs-on: ubuntu-latest
environment: release
needs: package

permissions:
# https://github.com/softprops/action-gh-release#permissions
contents: write
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./dist/*.tar.gz
./dist/*.whl
prerelease: ${{ contains(github.ref, '-rc') }}
generate_release_notes: ${{ !contains(github.ref, '-rc') }}
Expand Down

0 comments on commit 3e9615a

Please sign in to comment.