-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (43 loc) · 1.54 KB
/
deploy.yaml
File metadata and controls
52 lines (43 loc) · 1.54 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
on: [push, pull_request]
jobs:
build_wheels_sdist:
name: Build wheels and sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: '0'
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install setuptools_scm wheel
- name: Create setuptools_scm env variable
shell: bash
run: |
wget https://gist.github.com/plaplant/0902f09e59166bac742bbd554f3cd2f9/raw/make_dev_version.sh -O ../make_dev_version.sh
version=$(bash ../make_dev_version.sh)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$version" >> $GITHUB_ENV
- name: Build
run: |
python -m build
- uses: pypa/gh-action-pypi-publish@v1.13.0
name: Deploy to Test PyPi
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- uses: pypa/gh-action-pypi-publish@v1.13.0
name: Deploy To PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.pypi_password }}