-
-
Notifications
You must be signed in to change notification settings - Fork 40
57 lines (50 loc) · 1.82 KB
/
build_mac.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
name: Build and upload MacOS Python Package
on: [pull_request, release]
jobs:
deploy:
runs-on: macos-latest
env:
# Note that compiler options for macos-latest are documented here:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
HAS_SECRETS: ${{ secrets.AWS_SECRET_ACCESS_KEY != '' }}
CC: "gcc-12"
CXX: "g++-12"
continue-on-error: true
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
pip install -r requirements.txt
pip install -r requirements_additional.txt
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Stores artifacts along with the workflow result
if: ${{ github.event_name == 'push'}}
uses: actions/upload-artifact@v3
with:
name: library
path: dist/*.whl
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: Publish
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*.whl
- name: Publish tar files
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') && (matrix.python-version == '3.11') }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*.gz