-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.97 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
name: Build
on:
workflow_dispatch:
inputs:
publishReleases:
description: 'Publish to Releases'
required: false
default: 'true'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ 'macos-latest' ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
runs-on: ${{ matrix.os }}
name: ${{ github.event.inputs.tag }} python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Switch to Workspace
run: |
echo ${{ github.workspace }}
cd ${{ github.workspace }}
- name: Get Library Version
id: get_version
run: |
pip install setuptools
lib_version=$(python setup.py --version)
echo "Library Version: $lib_version"
echo ::set-output name=version::"$lib_version"
echo ::set-output name=v_version::"v$lib_version"
- name: Preqrequisites
run: |
git submodule update --init --recursive
# run build command
- name: Build
run: |
python -m pip install -r dev-requirements.txt
python setup.py build
python setup.py bdist_wheel --plat-name=macosx_10_9_universal2
ls dist
# upload dist
- name: Upload binaries to release
if: ${{ github.event.inputs.publishReleases == 'true' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.whl
tag: ${{ steps.get_version.outputs.v_version }}
release_name: "Version ${{ steps.get_version.outputs.version }}"
body: "Prebuilt wheel packages version ${{ steps.get_version.outputs.version }}."
overwrite: true
file_glob: true