-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Matthias Koeppe
committed
Nov 23, 2023
1 parent
d5c1fbf
commit 7e587b7
Showing
1 changed file
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build distributions | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
# Cancel previous runs of this workflow for the same branch | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
pypi: | ||
name: Build sdist and wheel (and upload to PyPI on release tags) | ||
runs-on: ubuntu-latest | ||
env: | ||
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
- name: build | ||
run: | | ||
python3 -m pip install build | ||
python3 -m build . | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: "dist/*" | ||
name: dist | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }} | ||
skip_existing: true | ||
verbose: true | ||
if: env.CAN_DEPLOY == 'true' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') |