Skip to content

Commit 7e587b7

Browse files
author
Matthias Koeppe
committed
.github/workflows/dist.yml: New
1 parent d5c1fbf commit 7e587b7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/dist.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build 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+
pypi:
16+
name: Build sdist and wheel (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: build
24+
run: |
25+
python3 -m pip install build
26+
python3 -m build .
27+
- uses: actions/upload-artifact@v3
28+
with:
29+
path: "dist/*"
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)