-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yuwei Yan
committed
Jan 6, 2025
1 parent
4a12bad
commit 68952b8
Showing
1 changed file
with
51 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,38 +22,59 @@ jobs: | |
deploy-linux: | ||
name: Build wheels for Linux | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for PyPI trusted publishing | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# ATTENTION: set CIBW_ENVIRONMENT=GITLAB_AUTH=username:token in your repository secrets | ||
- name: Build wheels | ||
env: | ||
CIBW_ENVIRONMENT: ${{ secrets.CIBW_ENVIRONMENT }} | ||
uses: pypa/[email protected] | ||
# ATTENTION: this step is mandatory for PyPI trusted publishing | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
packages-dir: wheelhouse/ | ||
deploy-macos: # WITHOUT testing | ||
- uses: actions/checkout@v4 | ||
- name: Build wheels for Linux | ||
env: | ||
CIBW_ENVIRONMENT: ${{ secrets.CIBW_ENVIRONMENT }} | ||
uses: pypa/[email protected] | ||
- name: Upload Linux wheels as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-wheels | ||
path: wheelhouse/ | ||
retention-days: 1 | ||
|
||
deploy-macos: | ||
name: Build wheels for macOS | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build wheels for macOS | ||
env: | ||
CIBW_ENVIRONMENT: ${{ secrets.CIBW_ENVIRONMENT }} | ||
uses: pypa/[email protected] | ||
- name: Upload macOS wheels as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: macos-wheels | ||
path: wheelhouse/ | ||
retention-days: 1 | ||
|
||
publish: | ||
name: Publish wheels to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [deploy-linux, deploy-macos] | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for PyPI trusted publishing | ||
id-token: write | ||
id-token: write # Required for PyPI trusted publishing | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# ATTENTION: set CIBW_ENVIRONMENT=GITLAB_AUTH=username:token in your repository secrets | ||
- name: Build wheels | ||
env: | ||
CIBW_ENVIRONMENT: ${{ secrets.CIBW_ENVIRONMENT }} | ||
uses: pypa/[email protected] | ||
# ATTENTION: this step is mandatory for PyPI trusted publishing | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
packages-dir: wheelhouse/ | ||
- name: Download Linux wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: linux-wheels | ||
path: linux-wheels | ||
- name: Download macOS wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: macos-wheels | ||
path: macos-wheels | ||
- name: Combine wheels into a single directory | ||
run: | | ||
mkdir -p wheelhouse | ||
cp linux-wheels/*.whl wheelhouse/ | ||
cp macos-wheels/*.whl wheelhouse/ | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
packages-dir: wheelhouse/ |