Skip to content

Commit

Permalink
udpate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
juaduan committed Jul 8, 2024
1 parent 4ecbbce commit fe9d08e
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '*'

jobs:
build:
build_wheels:
name: Build wheels on ${{ matrix.os }} 📦
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -33,10 +33,25 @@ jobs:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
- build_wheels
- build_sdist
runs-on: ubuntu-latest

environment:
Expand All @@ -60,8 +75,10 @@ jobs:
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: ./wheelhouse/
pattern: cibw-*
path: dist
merge-multiple: true


github-release:
name: >-
Expand All @@ -79,13 +96,16 @@ jobs:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: ./wheelhouse/
pattern: cibw-*
path: dist
merge-multiple: true

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./wheelhouse/*.whl
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -102,5 +122,5 @@ jobs:
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' ./wheelhouse/**
'${{ github.ref_name }}' ./dist/**
--repo '${{ github.repository }}'

0 comments on commit fe9d08e

Please sign in to comment.