-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Improve the wheel building workflow
- Loading branch information
Showing
1 changed file
with
50 additions
and
31 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 |
---|---|---|
@@ -1,36 +1,55 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published, edited] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: pip install wheel twine | ||
|
||
- name: Python info | ||
run: | | ||
which python | ||
python --version | ||
- name: Installed packages | ||
run: pip list | ||
|
||
- name: Build the package | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish the package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: pip install build twine | ||
|
||
- name: Python info | ||
run: | | ||
which python | ||
python --version | ||
- name: Installed packages | ||
run: pip list | ||
|
||
- name: Build the package | ||
run: python -m build --sdist --wheel | ||
|
||
- name: Validate wheels | ||
run: | | ||
tree dist | ||
twine check dist/* | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: ./build/* | ||
|
||
- name: Publish the package | ||
if: github.event_name == 'release' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: Attach wheels to GitHub release | ||
if: github.event_name == 'release' | ||
uses: AButler/[email protected] | ||
with: | ||
files: 'dist/*' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |