-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.onedev-buildspec.yml
More file actions
166 lines (166 loc) · 7.58 KB
/
.onedev-buildspec.yml
File metadata and controls
166 lines (166 loc) · 7.58 KB
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
version: 20
jobs:
- name: Build
jobExecutor: DockerExecutor
steps:
- !CheckoutStep
name: Checkout
cloneCredential: !DefaultCredential {}
withLfs: false
withSubmodules: false
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !CommandStep
name: Build
runInContainer: true
image: ubuntu:18.04
interpreter: !DefaultInterpreter
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/98keep-debs
- echo 'APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/99keep-debs
- dpkg --add-architecture i386
- apt -y update
- apt -y install build-essential
- apt -y install gcc-8
- apt -y install gcc-multilib
- apt -y install g++-8
- apt -y install g++-8-multilib
- apt -y install mingw-w64
- apt -y install make
- apt -y install zlib1g-dev
- apt -y install zlib1g-dev:i386
- apt -y install git
- apt -y install python3-pip
# - apt -y install rustc
# These were for using more recent C++ compiler with C++ 20 support but results in missing -lgcc for building 32-bit bindings
# rm /usr/bin/gcc && rm /usr/bin/g++ && ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ &&
# rm /usr/bin/gcc && rm /usr/bin/g++ && ln -s /usr/bin/gcc-7 /usr/bin/gcc && ln -s /usr/bin/g++-7 /usr/bin/g++ &&
# make ARCH=x32 py_bindings &&
# make ARCH=x32 rust_bindings &&
- apt -y install curl && export RUSTUP_HOME="/usr" && export CARGO_HOME="/usr" && curl https://sh.rustup.rs -sSf | sh -s -- -y
- pip3 install cffi
- tar xf upx/*linux-x86_64.tar.gz -C /usr/bin &&
make -j2 && mkdir output && make install DESTDIR=output &&
tar xf win32-patches/*.tar.gz &&
tar xf zlib-win32/*zlib-windows-x64.tar.gz &&
ln -sf $(pwd)/zlib-windows-x64/include/zlib.h /usr/x86_64-w64-mingw32/include/ &&
ln -sf $(pwd)/zlib-windows-x64/include/zconf.h /usr/x86_64-w64-mingw32/include/ &&
ln -sf $(pwd)/zlib-windows-x64/lib/libz.a /usr/x86_64-w64-mingw32/lib/ &&
tar xf zlib-win32/*zlib-windows-x32.tar.gz &&
ln -sf $(pwd)/zlib-windows-x32/include/zlib.h /usr/i686-w64-mingw32/include/ &&
ln -sf $(pwd)/zlib-windows-x32/include/zconf /usr/i686-w64-mingw32/include/ &&
ln -sf $(pwd)/zlib-windows-x32/lib/libz.a /usr/i686-w64-mingw32/lib/ &&
make ARCH=x32 -j2 && make ARCH=x32 install DESTDIR=output &&
rm /usr/bin/gcc && rm /usr/bin/g++ && ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ &&
make bindings &&
rm /usr/bin/gcc && rm /usr/bin/g++ && ln -s /usr/bin/gcc-7 /usr/bin/gcc && ln -s /usr/bin/g++-7 /usr/bin/g++ &&
make ARCH=x32 c_bindings &&
rm /usr/bin/gcc && rm /usr/bin/g++ && ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ &&
make ARCH=x32 cpp_bindings &&
rm /usr/bin/gcc && rm /usr/bin/g++ && ln -s /usr/bin/gcc-7 /usr/bin/gcc && ln -s /usr/bin/g++-7 /usr/bin/g++ &&
tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-extras-src.tar.gz extras ecrt/src ecrt/res default.cf crossplatform.mk &&
cd output && tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-output-linux.tar.gz * &&
cd .. && cd obj && tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-linux-x86_64.tar.gz
linux && tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-linux-i686.tar.gz
linux.x32 && cd .. &&
make PLATFORM=win32 &&
mkdir output-win32 &&
make PLATFORM=win32 cpp_bindings &&
make PLATFORM=win32 DESTDIR=output-win32 install &&
cd output-win32 &&
tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-output-windows-x86_64.tar.gz * &&
cd .. && make PLATFORM=win32 ARCH=x32 &&
make PLATFORM=win32 ARCH=x32 cpp_bindings &&
mkdir output-win32-x32 &&
make PLATFORM=win32 ARCH=x32 DESTDIR=output-win32-x32 install &&
cd output-win32-x32 && tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-output-windows-i686.tar.gz * &&
cd .. &&
cd obj && tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-windows-x86_64.tar.gz win32 &&
tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-windows-i686.tar.gz win32.x32 &&
cd .. &&
tar czf @project_name@-@tag@-@branch@-@commit_hash@-@build_number@-bindings.tar.gz bindings
useTTY: true
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsLinuxInstall
sourcePath: output
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-output-linux.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsWindowsInstall
sourcePath: output-win32
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-output-windows-x86_64.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsWindows32BitInstall
sourcePath: output-win32-x32
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-output-windows-i686.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsLinuxBinaries
sourcePath: obj
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-linux-x86_64.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsLinux32BitBinaries
sourcePath: obj
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-linux-i686.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsBindings
sourcePath: .
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-bindings.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsWindowsBinaries
sourcePath: obj
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-windows-x86_64.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsWindows32BitBinaries
sourcePath: obj
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-binaries-windows-i686.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
- !PublishArtifactStep
name: ArtefactsExtrasSource
sourcePath: .
artifacts: '@project_name@-@tag@-@branch@-@commit_hash@-@build_number@-extras-src.tar.gz'
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
triggers:
- !PullRequestUpdateTrigger
projects: eC
- !BranchUpdateTrigger
projects: eC
projectDependencies:
- projectPath: zlib-win32
buildProvider: !LastFinishedBuild
jobName: Build
refName: refs/heads/main
artifacts: '**'
accessTokenSecret: deps-access
destinationPath: zlib-win32
- projectPath: win32-patches
buildProvider: !LastFinishedBuild
jobName: Build
refName: refs/heads/master
artifacts: '**'
accessTokenSecret: deps-access
destinationPath: win32-patches
- projectPath: upx
buildProvider: !LastFinishedBuild
jobName: Build
refName: refs/heads/master
artifacts: '**'
accessTokenSecret: deps-access
destinationPath: upx
retryCondition: never
maxRetries: 3
retryDelay: 30
caches:
- key: AptCache
path: /var/cache/apt
- key: AptList
path: /var/lib/apt/lists
- key: pip
path: /root/.cache/pip
timeout: 3600