Skip to content

Commit 907a69b

Browse files
author
Matthias Koeppe
committed
.github/workflows/dist.yml: New
1 parent 0a540ae commit 907a69b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/dist.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Distributions
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
# Cancel previous runs of this workflow for the same branch
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
15+
sdists_for_pypi:
16+
name: Build sdist (and upload to PyPI on release tags)
17+
runs-on: ubuntu-latest
18+
env:
19+
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v4
23+
- name: make sdist
24+
run: |
25+
python3 -m pip install build
26+
python3 -m build --sdist
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
path: "dist/*.tar.gz"
30+
name: dist
31+
- uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
user: __token__
34+
password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }}
35+
skip_existing: true
36+
verbose: true
37+
if: env.CAN_DEPLOY == 'true' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

0 commit comments

Comments
 (0)