-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify and streamline release GitHub workflow
Simplify: use only one command to build both the wheel and source distribution using the build module, as recommended by packaging.python.org Streamline: only trigger the upload_test_pypi job when manually running the workflow. Before, it would also trigger on releases, but this is unnecessary. This way, the test.pypi.org channel can also be used to test an upload without having to bump the version.
- Loading branch information
Showing
2 changed files
with
9 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 |
---|---|---|
|
@@ -7,67 +7,44 @@ on: | |
- published | ||
|
||
jobs: | ||
build_wheel: | ||
name: Build universal wheel | ||
build: | ||
name: Build universal wheel and source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/actions/install-python-and-package | ||
with: | ||
extras-require: publishing | ||
|
||
- name: Build wheel | ||
run: python setup.py bdist_wheel | ||
|
||
- name: Build wheel and source distribution | ||
run: python -m build | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: ./.github/actions/install-python-and-package | ||
with: | ||
extras-require: publishing | ||
|
||
- name: Build sdist | ||
run: python setup.py sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
path: dist/* | ||
|
||
upload_test_pypi: | ||
needs: [build_wheel, build_sdist] | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'workflow_dispatch' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
|
||
upload_pypi: | ||
needs: [build_wheel, build_sdist] | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
|
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 |
---|---|---|
|
@@ -72,6 +72,7 @@ dev = | |
pandoc | ||
myst-parser | ||
publishing = | ||
build | ||
twine | ||
wheel | ||
notebooks = | ||
|