-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (57 loc) · 1.73 KB
/
build.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Main workflow
on:
pull_request:
push:
schedule:
- cron: '5 14 * * *'
jobs:
check-version-numbers:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check version numbers
run: ./version.sh
package-python:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Upgrade pip and build
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
- name: Build wheel
run: python3 -m build
- name: Upload binary wheel
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*.whl
deploy:
needs:
- check-version-numbers
- package-python
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
steps:
- name: Download distributions
uses: actions/download-artifact@v4
# - name: Deploy test distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# verbose: true
# repository_url: https://test.pypi.org/legacy/
# skip_existing: true
- name: Deploy tagged release on PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true