-
Notifications
You must be signed in to change notification settings - Fork 304
150 lines (128 loc) · 4.2 KB
/
build_wrapper.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Multiplatform build of libuuu wrapper python package
on:
push:
branches: [master]
jobs:
build-dlls:
name: Build of dynamically linked libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout uuu repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: false
- name: Clone vcpkg repository
run: |
git clone https://github.com/microsoft/vcpkg.git
- name: Set up vcpkg on Windows
working-directory: ./vcpkg
if: matrix.os == 'windows-latest'
run: |
echo ("VCPKG_ROOT=" + $PWD.Path) >> $env:GITHUB_ENV
./bootstrap-vcpkg.bat
- name: Set up vcpkg on Ubuntu and MacOS
working-directory: ./vcpkg
if: matrix.os != 'windows-latest'
run: |
echo "VCPKG_ROOT=$(pwd)" >> $GITHUB_ENV
./bootstrap-vcpkg.sh
- name: Install dependencies Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install gcc cmake ninja-build autotools-dev automake autoconf libudev-dev
- name: Install dependencies MacOS
if: matrix.os == 'macos-latest'
run: |
brew install ninja cmake autoconf automake libtool
- name: Install dependencies Windows
if: matrix.os == 'windows-latest'
run: |
choco install cmake pkgconfiglite
- name: Build on Ubuntu and MacOS
working-directory: ./wrapper
if: matrix.os != 'windows-latest'
run: |
export PATH=$VCPKG_ROOT:$PATH
cmake --preset=unix
cmake --build build
- name: Build on Windows
working-directory: ./wrapper
if: matrix.os == 'windows-latest'
run: |
$env:Path = $env:VCPKG_ROOT + ';' + $env:Path
cmake --preset=windows
cmake --build build
- name: Upload artifacts Windows
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: libuuu-windows
path: ./wrapper/build/Debug/*.dll
- name: Upload artifacts MacOS
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: libuuu-macos
path: ./wrapper/build/libuuu.dylib
- name: Upload artifacts Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: libuuu-ubuntu
path: ./wrapper/build/libuuu.so
build-libuuu-wrapper:
runs-on: ubuntu-latest
needs: build-dlls
steps:
- name: Checkout uuu repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: false
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: libuuu-*
merge-multiple: true
path: ./wrapper/libuuu/lib/
- name: Check the path
run: |
find ./wrapper/
- name: Install python dependencies
working-directory: ./wrapper
run: |
pip install --upgrade pip
pip install --force-reinstall -U build twine nxp-codecheck colorama setuptools_scm
- name: Build the python package
working-directory: ./wrapper
run: |
python -m build --sdist --wheel
- name: Run codecheck
working-directory: ./wrapper
run: |
codecheck -s
- name: Upload reports if codecheck fails
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: reports
path: ./wrapper/reports/*
- name: Release package to pypi
if: github.ref_type == 'tag'
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
#TWINE_REPOSITORY_URL: ${{ secrets.TWINE_REPOSITORY_URL }}
working-directory: ./wrapper
run: |
twine --no-color check dist/*
twine --no-color upload --repository pypi dist/*
- name: Upload the dist folder
uses: actions/upload-artifact@v4
with:
name: dist
path: ./wrapper/dist