-
Notifications
You must be signed in to change notification settings - Fork 2
261 lines (221 loc) · 7.02 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
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
name: '🏦 Build'
env:
VERSION: 1.6.2
# PACKAGE_SUFFIX: '-pre.1'
PACKAGE_SUFFIX: ''
ASM_VERSION: 1.0.0
BUILD_TYPE: Release
VCPKG_HASH: 0f88ecb8528605f91980b90a2c5bad88e3cb565f
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
# builds native codecs binary for all supported OSes
build-native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
name: Linux x64
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-x64
- os: ubuntu-22.04
name: Linux x64 musl
arch: x64
vcpkg_triplet: x64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-musl-x64
cmake_options: -D CMAKE_C_FLAGS="-static -Os"
- os: ubuntu-20.04
name: Linux ARM
arch: arm64
vcpkg_triplet: arm64-linux
vcpkg_config: RelWithDebInfo
dotnet_rid: linux-arm64
no_native_tests: true
cmake_options: -D CMAKE_SYSTEM_PROCESSOR=aarch64 -D CMAKE_C_COMPILER=$(which aarch64-linux-gnu-gcc) -D CMAKE_CXX_COMPILER=$(which aarch64-linux-gnu-g++)
- os: windows-latest
name: Windows x64
arch: x64
vcpkg_triplet: x64-windows-static
vcpkg_config: Release
dotnet_rid: win-x64
# Still can't make this build
# - os: windows-latest
# arch: x86
# vcpkg_triplet: x86-windows-static
# vcpkg_config: Release
# dotnet_rid: win-x86
# cmake_options: -D CMAKE_GENERATOR_PLATFORM=x86
- os: macos-latest
name: MacOS ARM
arch: arm64
vcpkg_triplet: arm64-osx
vcpkg_config: RelWithDebInfo
dotnet_rid: osx-arm64
cmake_options: -D CMAKE_OSX_ARCHITECTURES=arm64
fail-fast: false
name: 'build: ${{ matrix.name }}'
env:
VCPKG_DEFAULT_VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
VCPKG_CONFIG: ${{ matrix.vcpkg_config }}
DOTNET_RID: ${{ matrix.dotnet_rid }}
NO_NATIVE_SNAPPY: ${{ matrix.no_native_snappy }}
NO_NATIVE_ZSTD: ${{ matrix.no_native_zstd }}
CMAKE_OPTIONS: ${{ matrix.cmake_options }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Linux ARM
if: runner.os == 'Linux' && matrix.arch == 'arm64'
run: |
sudo apt-get update
sudo apt-get --yes install g++-aarch64-linux-gnu pkg-config-aarch64-linux-gnu
- uses: friendlyanon/setup-vcpkg@v1
# seems like the absense of commit hash expects vcpkg submodule, i don't want that
with:
committish: ${{ env.VCPKG_HASH }}
# set to false to clear any cache in case of build errors
cache: false
- name: configure
run: cmake -B build -S . -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -D "CMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" -D "VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TRIPLET }}" ${{ env.CMAKE_OPTIONS }}
working-directory: native
- name: build
run: cmake --build build --config ${{ env.VCPKG_CONFIG }}
working-directory: native
- name: debug
run: ls -R
working-directory: native/build
- name: test
if: runner.os != 'Windows' && !matrix.no_native_tests
run: ctest
working-directory: native/build
- name: test (windows .exe)
if: runner.os == 'Windows' && !matrix.no_native_tests
run: |
ls -R
pwd
.\tests.exe
working-directory: native/build/Release
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: native-${{ matrix.dotnet_rid }}
path: |
native/ubin/**/*
if-no-files-found: error
# create a unified fat native binary
make-fat-native:
runs-on: ubuntu-latest
needs: build-native
name: '🎡 fat artifact'
steps:
- uses: actions/download-artifact@v4
with:
pattern: native-*
path: native/ubin/
merge-multiple: true
- name: debug
run: ls -R
working-directory: .
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: native-fat
compression-level: 9
if-no-files-found: error
path: |
native/ubin/**/*
test-managed:
runs-on: ${{ matrix.os }}
needs: make-fat-native
strategy:
matrix:
include:
- os: ubuntu-20.04
dotnet_rid: linux-x64
- os: ubuntu-22.04
dotnet_rid: linux-x64
- os: windows-2022
dotnet_rid: win-x64
- os: macos-latest
dotnet_rid: osx-arm64
fail-fast: false
name: 'managed test on ${{ matrix.os }}'
#env:
# LD_DEBUG: libs
# DYLD_PRINT_LIBRARIES: 1
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: native-fat
path: native/ubin/
- name: debug1
run: ls -R
working-directory: native
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: build
run: dotnet build managed/IronCompress.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
- name: debug2
run: ls -R
working-directory: .
- name: Test
run: dotnet test managed/IronCompress.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
build-managed:
needs: make-fat-native
runs-on: ubuntu-latest
name: 'Build managed + nuget'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: native-fat
path: native/ubin/
- name: debug
run: ls -R
working-directory: native
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Build
run: dotnet build managed/IronCompress.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
- name: version
run: echo $VERSION >> docs/version.txt
- name: 🔢 prep release notes
run: |
grep -m 2 -B 1000 '^## ' docs/release-notes.md | tail -n +3 | head -n -2 > docs/version-notes.md
cat docs/version-notes.md
- uses: actions/upload-artifact@v4
name: Collect Artifacts
with:
name: managed
compression-level: 9
if-no-files-found: error
path: |
managed/IronCompress/bin/Release/**/*nupkg
docs/release-notes.md
docs/version-notes.md
docs/version.txt