-
-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (33 loc) · 1013 Bytes
/
dist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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')