forked from ghaerr/agg-2.6
-
Notifications
You must be signed in to change notification settings - Fork 0
302 lines (301 loc) · 12.4 KB
/
ci.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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
name: ci
on:
push: {branches-ignore: [latest], tags: ['*']}
pull_request:
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
PACKAGE_VERSION: ${{ github.sha }}
MYCI_NEXUS_USERNAME: cppfw
MYCI_NEXUS_PASSWORD: ${{ secrets.MYCI_NEXUS_PASSWORD }}
MYCI_GIT_USERNAME: igagis
MYCI_GIT_PASSWORD: ${{ secrets.MYCI_GIT_ACCESS_TOKEN }}
MYCI_CONAN_REMOTE: http://gagis.hopto.org/conan
MYCI_CONAN_USER: cppfw
MYCI_CONAN_PASSWORD: ${{ secrets.MYCI_CONAN_PASSWORD }}
CONAN_V2_MODE: 1
CONAN_REVISIONS_ENABLED: 1
CONAN_SCM_TO_CONANDATA: 1
jobs:
##### linux #####
linux:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: buster, image_owner: , package_type: deb}
- {os: debian, codename: buster, image_owner: i386/, package_type: deb, labels: [i386,docker]}
- {os: debian, codename: buster, image_owner: arm32v7/, package_type: deb, labels: [arm,docker]}
- {os: ubuntu, codename: focal, image_owner: , package_type: deb}
- {os: raspbian, codename: buster, image_owner: igagis/, package_type: deb, labels: [arm,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb http://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci git
- name: install ci tools
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
- name: prepare debian package
run: myci-deb-prepare.sh --soname $(cat soname.txt)
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: dpkg-buildpackage --unsigned-source --unsigned-changes
- name: deploy deb packages
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-debian-ssh-freight.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib$(cat name.txt)*_${PACKAGE_VERSION}_*.deb
if: matrix.package_type == 'deb' && startsWith(github.ref, 'refs/tags/')
##### macosx #####
macosx:
runs-on: macos-latest
steps:
- name: git clone
uses: myci-actions/checkout@master
- name: add cppfw tap
run: |
brew tap cppfw/tap
brew update
- name: install ci tools
run: brew install myci make
- name: set PATH to use latest make
uses: myci-actions/export-env-var@master
with: {name: PATH, value: "/usr/local/opt/make/libexec/gnubin:$PATH"}
- name: install deps
run: myci-brew-install.sh `myci-list-deps-homebrew.sh`
- name: build
run: make autojobs=true
- name: test
run: make test autojobs=true
- name: deploy
run: myci-deploy-homebrew.sh --tap cppfw/tap
if: startsWith(github.ref, 'refs/tags/')
##### ios #####
ios:
runs-on: macos-latest
steps:
- name: add cppfw tap
run: |
brew tap cppfw/tap
brew update
- name: install ci tools
run: brew install myci
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
- name: add cocoapods repo
run: pod repo add --silent cppfw https://[email protected]/cppfw/cocoapods-repo.git
- name: install deps
run: pod install --project-directory=xcode
- name: add sources to xcode project
run: |
curl -L https://github.com/zackslash/Xcode-Proj-Adder/raw/master/bin/XcodeProjAdder -O
chmod +x XcodeProjAdder
cd xcode/$PACKAGE_NAME
../../XcodeProjAdder -XCP $PACKAGE_NAME.xcodeproj -SCSV `echo $(ls ../../src/agg/src/*.cpp) | sed -E -e 's/ /,/g'`
- name: build
run: xcodebuild -workspace xcode/$PACKAGE_NAME.xcworkspace -scheme $PACKAGE_NAME CONFIGURATION_BUILD_DIR=../build -configuration Release
- name: create package
run: myci-create-zip-package.sh --headers-dir src/agg/include///agg --file xcode/build/lib$PACKAGE_NAME.a///lib/ios --file LICENSE $PACKAGE_NAME-$PACKAGE_VERSION.zip
- name: deploy
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-cocoapods-ssh.sh --repo cppfw --version $PACKAGE_VERSION --server gagis.hopto.org --key repo_key_rsa --generic-repo cppfw/cocoapods --package $PACKAGE_NAME-$PACKAGE_VERSION.zip cocoapods/$PACKAGE_NAME.podspec.in
if: startsWith(github.ref, 'refs/tags/')
##### android #####
android:
runs-on: ubuntu-latest
container: mingc/android-build-box:latest
steps:
- name: git clone
uses: myci-actions/checkout@master
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb http://gagis.hopto.org/repo/cppfw/$(lsb_release --id --short | tr '[:upper:]' '[:lower:]') $(lsb_release --codename --short) main
repo-name: cppfw
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
- name: build
run: |
cd android
./gradlew copy_aar --warning-mode all
myci-apply-version.sh -v $PACKAGE_VERSION *.pom.in
myci-apply-version.sh -v $PACKAGE_VERSION *.aar.in --filename-only
- name: deploy
run: myci-deploy-maven-nexus.sh --base-url http://gagis.hopto.org/nexus --repo android android/$PACKAGE_NAME-$PACKAGE_VERSION.aar
if: startsWith(github.ref, 'refs/tags/')
##### msys2 #####
msys2:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
include:
- {arch: i686, repo: mingw32}
- {arch: x86_64, repo: mingw64}
name: msys2 - ${{ matrix.repo }}
steps:
- name: make msys2 to provide the default shell
uses: msys2/setup-msys2@v2
with:
update: true
msystem: MSYS
install: >-
msys2-devel
mingw-w64-${{ matrix.arch }}-toolchain
- name: add cppfw pacman msys repo
uses: myci-actions/add-pacman-repo@master
with:
name: cppfw_msys
url: http://gagis.hopto.org/repo/cppfw/msys2/msys
shell: 'msys2 {0}'
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci
- name: add cppfw pacman msys/mingw repo
uses: myci-actions/add-pacman-repo@master
with:
name: cppfw_${{ matrix.repo }}
url: http://gagis.hopto.org/repo/cppfw/msys2/${{ matrix.repo }}
shell: 'msys2 {0}'
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
- name: git clone
uses: myci-actions/checkout@master
- name: prepare pacman package
run: myci-apply-version.sh -v $(myci-deb-version.sh debian/changelog) msys2/PKGBUILD.in
- name: build
# to make makepkg-mingw build only one architecture we need to set the MINGW_INSTALLS
env: {MINGW_INSTALLS: '${{ matrix.repo }}'}
run: |
cd msys2
PKGEXT='.pkg.tar.xz' autojobs=true makepkg-mingw --syncdeps --noconfirm --skipinteg
- name: deploy
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
for f in $(find msys2 -name "mingw-w64-${{ matrix.arch }}-$PACKAGE_NAME-*-any.pkg.*"); do
myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/msys2/${{ matrix.repo }} --database cppfw_${{ matrix.repo }} $f
done
if: startsWith(github.ref, 'refs/tags/')
##### msvs #####
msvs:
runs-on: windows-latest
defaults:
run:
shell: powershell
steps:
- name: git clone
uses: actions/checkout@v2
- name: install CoAPP tools
uses: myci-actions/install-coapp-tools@master
- name: nuget update
run: |
nuget restore msvs_solution/msvs_solution.sln
nuget update msvs_solution/msvs_solution.sln
- name: add msbuild to PATH
uses: microsoft/[email protected]
- name: build
run: .\nuget\build_nuget.ps1
- name: deploy
uses: myci-actions/publish-nuget@master
with:
filename: '.\nuget\*.nupkg'
api-key: ${{ secrets.NUGET_DOT_ORG_API_KEY }}
if: startsWith(github.ref, 'refs/tags/')
##### conan - linux #####
conan-linux:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: buster, image_owner: , arch: x86_64}
# - {os: debian, codename: buster, image_owner: i386/, arch: x86, labels: [i386,docker]}
- {os: debian, codename: buster, image_owner: arm32v7/, arch: armhf, labels: [arm,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: conan - linux - ${{ matrix.arch }}
steps:
- name: clean
uses: myci-actions/clean@master
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb http://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: devscripts equivs myci prorab prorab-extra python3-pip cmake git
- name: install conan
run: |
pip3 install conan
conan profile new --detect default
conan profile update settings.compiler.libcxx=libstdc++11 default
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
if: startsWith(github.ref, 'refs/tags/')
- name: prepare conanfile
run: myci-apply-version.sh -v $PACKAGE_VERSION conan/conanfile.py.in
- name: build
run: |
conan remote add cppfw $MYCI_CONAN_REMOTE
conan create conan $MYCI_CONAN_USER/main --ignore-dirty
- name: deploy conan package
run: |
conan user --remote cppfw --password $MYCI_CONAN_PASSWORD $MYCI_CONAN_USER
conan upload --remote cppfw --all $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')
##### conan - macosx #####
conan-macosx:
name: conan - macosx
runs-on: macos-latest
steps:
- name: git clone
uses: myci-actions/checkout@master
- name: add cppfw tap
run: |
brew tap cppfw/tap
brew update
- name: install ci tools
run: brew install myci prorab prorab-extra conan make
- name: set PATH
uses: myci-actions/export-env-var@master
with: {name: PATH, value: "/usr/local/opt/make/libexec/gnubin:$PATH"}
- name: GNU make version
run: make --version
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
if: startsWith(github.ref, 'refs/tags/')
- name: prepare conanfile
run: myci-apply-version.sh -v $PACKAGE_VERSION conan/conanfile.py.in
- name: build
run: |
conan remote add cppfw $MYCI_CONAN_REMOTE
conan create conan $MYCI_CONAN_USER/main --ignore-dirty
- name: deploy conan package
run: |
conan user --remote cppfw --password $MYCI_CONAN_PASSWORD $MYCI_CONAN_USER
conan upload --remote cppfw --all $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')