Skip to content

Commit fdffc3b

Browse files
ci: optimize build
1 parent e2777d3 commit fdffc3b

File tree

2 files changed

+16
-88
lines changed

2 files changed

+16
-88
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
build-windows-arm64:
5454
name: Build on Windows ARM64 (MSVC)
55-
runs-on: windows-2022
55+
runs-on: windows-11-arm
5656
steps:
5757
- name: Checkout repository
5858
uses: actions/checkout@v4
@@ -95,7 +95,7 @@ jobs:
9595
name: Build on Linux X86_64 (GCC)
9696
runs-on: ubuntu-24.04
9797
container:
98-
image: ubuntu:22.04
98+
image: ubuntu:20.04
9999
options: --privileged
100100
steps:
101101
- name: Checkout repository
@@ -145,9 +145,9 @@ jobs:
145145

146146
build-linux-arm64:
147147
name: Build on Linux ARM64 (GCC)
148-
runs-on: ubuntu-24.04
148+
runs-on: ubuntu-24.04-arm
149149
container:
150-
image: ubuntu:22.04
150+
image: ubuntu:20.04
151151
options: --privileged
152152
steps:
153153
- name: Checkout repository
@@ -165,30 +165,28 @@ jobs:
165165
apt-get install -y --no-install-recommends gcc-13 g++-13
166166
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
167167
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
168-
apt-get update -y
169-
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
170-
168+
171169
- name: Install xmake
172170
uses: xmake-io/github-action-setup-xmake@v1
173171

174172
- name: Build BinaryStream Static (Debug)
175173
run: |
176-
xmake f --mode=debug --kind=static --arch=arm64 --sdk=/usr/aarch64-linux-gnu --bin=/usr/bin --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ld=aarch64-linux-gnu-g++ --sh=aarch64-linux-gnu-g++ --root
174+
xmake f --mode=debug --kind=static --root
177175
xmake --all --root
178176
179177
- name: Build BinaryStream Shared (Debug)
180178
run: |
181-
xmake f --mode=debug --kind=shared --arch=arm64 --sdk=/usr/aarch64-linux-gnu --bin=/usr/bin --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ld=aarch64-linux-gnu-g++ --sh=aarch64-linux-gnu-g++ --root
179+
xmake f --mode=debug --kind=shared --root
182180
xmake --all --root
183181
184182
- name: Build BinaryStream Static (Release)
185183
run: |
186-
xmake f --mode=release --kind=static --arch=arm64 --sdk=/usr/aarch64-linux-gnu --bin=/usr/bin --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ld=aarch64-linux-gnu-g++ --sh=aarch64-linux-gnu-g++ --root
184+
xmake f --mode=release --kind=static --root
187185
xmake --all --root
188186
189187
- name: Build BinaryStream Shared (Release)
190188
run: |
191-
xmake f --mode=release --kind=shared --arch=arm64 --sdk=/usr/aarch64-linux-gnu --bin=/usr/bin --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ld=aarch64-linux-gnu-g++ --sh=aarch64-linux-gnu-g++ --root
189+
xmake f --mode=release --kind=shared --root
192190
xmake --all --root
193191
194192
- name: Upload Artifact
@@ -197,42 +195,6 @@ jobs:
197195
name: BinaryStream-linux-arm64-${{ github.sha }}
198196
path: artifacts/BinaryStream-linux-arm64.zip
199197

200-
build-macos-x86_64:
201-
name: Build on MacOS X86_64 (Clang)
202-
runs-on: macos-14
203-
steps:
204-
- name: Checkout repository
205-
uses: actions/checkout@v4
206-
207-
- name: Install xmake
208-
uses: xmake-io/github-action-setup-xmake@v1
209-
210-
- name: Build BinaryStream Static (Debug)
211-
run: |
212-
xmake f --mode=debug --arch=x86_64 --kind=static
213-
xmake --all
214-
215-
- name: Build BinaryStream Shared (Debug)
216-
run: |
217-
xmake f --mode=debug --arch=x86_64 --kind=shared
218-
xmake --all
219-
220-
- name: Build BinaryStream Static (Release)
221-
run: |
222-
xmake f --mode=release --arch=x86_64 --kind=static
223-
xmake --all
224-
225-
- name: Build BinaryStream Shared (Release)
226-
run: |
227-
xmake f --mode=release --arch=x86_64 --kind=shared
228-
xmake --all
229-
230-
- name: Upload Artifact
231-
uses: actions/upload-artifact@v4
232-
with:
233-
name: BinaryStream-macosx-x86_64-${{ github.sha }}
234-
path: artifacts/BinaryStream-macosx-x86_64.zip
235-
236198
build-macos-arm64:
237199
name: Build on MacOS ARM64 (Clang)
238200
runs-on: macos-14

.github/workflows/release.yml

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
build-windows-arm64:
3939
name: Build on Windows ARM64 (MSVC)
40-
runs-on: windows-2022
40+
runs-on: windows-11-arm
4141
steps:
4242
- name: Checkout repository
4343
uses: actions/checkout@v4
@@ -70,7 +70,7 @@ jobs:
7070
name: Build on Linux X86_64 (GCC)
7171
runs-on: ubuntu-24.04
7272
container:
73-
image: ubuntu:22.04
73+
image: ubuntu:20.04
7474
options: --privileged
7575
steps:
7676
- name: Checkout repository
@@ -110,9 +110,9 @@ jobs:
110110

111111
build-linux-arm64:
112112
name: Build on Linux ARM64 (GCC)
113-
runs-on: ubuntu-24.04
113+
runs-on: ubuntu-24.04-arm
114114
container:
115-
image: ubuntu:22.04
115+
image: ubuntu:20.04
116116
options: --privileged
117117
steps:
118118
- name: Checkout repository
@@ -130,20 +130,18 @@ jobs:
130130
apt-get install -y --no-install-recommends gcc-13 g++-13
131131
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
132132
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
133-
apt-get update -y
134-
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
135-
133+
136134
- name: Install xmake
137135
uses: xmake-io/github-action-setup-xmake@v1
138136

139137
- name: Build BinaryStream Static (Release)
140138
run: |
141-
xmake f --mode=release --kind=static --arch=arm64 --sdk=/usr/aarch64-linux-gnu --bin=/usr/bin --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ld=aarch64-linux-gnu-g++ --sh=aarch64-linux-gnu-g++ --root
139+
xmake f --mode=release --kind=static --root
142140
xmake --all --root
143141
144142
- name: Build BinaryStream Shared (Release)
145143
run: |
146-
xmake f --mode=release --kind=shared --arch=arm64 --sdk=/usr/aarch64-linux-gnu --bin=/usr/bin --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ld=aarch64-linux-gnu-g++ --sh=aarch64-linux-gnu-g++ --root
144+
xmake f --mode=release --kind=shared --root
147145
xmake --all --root
148146
149147
- name: Upload Artifact
@@ -152,32 +150,6 @@ jobs:
152150
name: BinaryStream-linux-arm64-${{ github.sha }}
153151
path: artifacts/BinaryStream-linux-arm64.zip
154152

155-
build-macos-x86_64:
156-
name: Build on MacOS X86_64 (Clang)
157-
runs-on: macos-14
158-
steps:
159-
- name: Checkout repository
160-
uses: actions/checkout@v4
161-
162-
- name: Install xmake
163-
uses: xmake-io/github-action-setup-xmake@v1
164-
165-
- name: Build BinaryStream Static (Release)
166-
run: |
167-
xmake f --mode=release --arch=x86_64 --kind=static
168-
xmake --all
169-
170-
- name: Build BinaryStream Shared (Release)
171-
run: |
172-
xmake f --mode=release --arch=x86_64 --kind=shared
173-
xmake --all
174-
175-
- name: Upload Artifact
176-
uses: actions/upload-artifact@v4
177-
with:
178-
name: BinaryStream-macosx-x86_64-${{ github.sha }}
179-
path: artifacts/BinaryStream-macosx-x86_64.zip
180-
181153
build-macos-arm64:
182154
name: Build on MacOS ARM64 (Clang)
183155
runs-on: macos-14
@@ -283,7 +255,6 @@ jobs:
283255
- build-windows-arm64
284256
- build-linux-x86_64
285257
- build-linux-arm64
286-
- build-macos-x86_64
287258
- build-macos-arm64
288259
- build-android-x86_64
289260
- build-android-arm64
@@ -313,11 +284,6 @@ jobs:
313284
name: BinaryStream-linux-arm64-${{ github.sha }}
314285
path: artifact
315286

316-
- uses: actions/download-artifact@v4
317-
with:
318-
name: BinaryStream-macosx-x86_64-${{ github.sha }}
319-
path: artifact
320-
321287
- uses: actions/download-artifact@v4
322288
with:
323289
name: BinaryStream-macosx-arm64-${{ github.sha }}

0 commit comments

Comments
 (0)