Skip to content

Commit 68f877f

Browse files
authored
add mac arm (#449)
1 parent b3a2ffa commit 68f877f

File tree

5 files changed

+179
-2
lines changed

5 files changed

+179
-2
lines changed

.semaphore/semaphore.yml

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ blocks:
9494
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
9595
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
9696
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
97+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
9798
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
9899
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
99100
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
101+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
100102
- bash release/create.sh
101103
- source release/install_in_tests.sh
102104
- git submodule init && git submodule update
@@ -137,9 +139,11 @@ blocks:
137139
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
138140
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
139141
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
142+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
140143
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
141144
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
142145
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
146+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
143147
- bash release/create.sh
144148
- source release/install_in_tests.sh
145149
- git submodule init && git submodule update
@@ -180,9 +184,11 @@ blocks:
180184
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
181185
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
182186
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
187+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
183188
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
184189
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
185190
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
191+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
186192
- bash release/create.sh
187193
- source release/install_in_tests.sh
188194
- git submodule init && git submodule update
@@ -223,9 +229,11 @@ blocks:
223229
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
224230
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
225231
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
232+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
226233
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
227234
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
228235
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
236+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
229237
- bash release/create.sh
230238
- source release/install_in_tests.sh
231239
- git submodule init && git submodule update
@@ -258,9 +266,11 @@ blocks:
258266
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
259267
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
260268
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
269+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
261270
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
262271
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
263272
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
273+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
264274
- bash release/create.sh
265275
- source tests/sftp_server/start_on_mac.sh
266276
- source release/install_in_tests.sh
@@ -281,9 +291,11 @@ blocks:
281291
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
282292
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
283293
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
294+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
284295
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
285296
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
286297
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
298+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
287299
- bash release/create.sh
288300
- source release/create.sh
289301
- cd ~/$SEMAPHORE_GIT_DIR/
@@ -307,7 +319,7 @@ blocks:
307319
commands:
308320
- bash tests/sem_service/$TEST
309321

310-
- name: "Bats: Mac"
322+
- name: "Bats: xcode14"
311323
dependencies:
312324
- "Build local CLIs"
313325
task:
@@ -322,9 +334,11 @@ blocks:
322334
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
323335
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
324336
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
337+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
325338
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
326339
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
327340
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
341+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
328342
- bash release/create.sh
329343
- source tests/sftp_server/start_on_mac.sh
330344

@@ -363,6 +377,64 @@ blocks:
363377
commands:
364378
- 'test-results publish report.xml --name="Bats: Mac" --suite-prefix=$TEST'
365379

380+
- name: "Bats: xcode15 arm"
381+
dependencies:
382+
- "Build local CLIs"
383+
task:
384+
agent:
385+
machine:
386+
type: a2-standard-4
387+
os_image: macos-xcode15
388+
389+
prologue:
390+
commands:
391+
- checkout
392+
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
393+
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
394+
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
395+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
396+
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
397+
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
398+
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
399+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
400+
- bash release/create.sh
401+
- source tests/sftp_server/start_on_mac.sh
402+
403+
jobs:
404+
- name: "Cache tests"
405+
matrix:
406+
- env_var: TEST
407+
values:
408+
- tests/libcheckout.bats
409+
- env_var: SEMAPHORE_CACHE_ARCHIVE_METHOD
410+
values:
411+
- shell-out
412+
- native
413+
- native-parallel
414+
commands:
415+
- source release/install_in_tests.sh
416+
- git submodule init && git submodule update
417+
- sudo ./tests/support/bats-core/install.sh /usr/local
418+
- bats --report-formatter junit --tap --timing $TEST
419+
420+
- name: "Non-cache tests"
421+
matrix:
422+
- env_var: TEST
423+
values:
424+
- tests/artifacts.bats
425+
- tests/test-results.bats
426+
- tests/xcode15_sem_version.bats
427+
- tests/sem-semantic-release.bats
428+
commands:
429+
- source release/install_in_tests.sh
430+
- git submodule init && git submodule update
431+
- sudo ./tests/support/bats-core/install.sh /usr/local
432+
- bats --report-formatter junit --tap --timing $TEST
433+
epilogue:
434+
always:
435+
commands:
436+
- 'test-results publish report.xml --name="Bats: Mac" --suite-prefix=$TEST'
437+
366438
- name: "Bats: Docker"
367439
dependencies:
368440
- "Build local CLIs"
@@ -380,9 +452,11 @@ blocks:
380452
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
381453
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
382454
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
455+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
383456
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
384457
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
385458
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
459+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
386460
- bash release/create.sh
387461
- source tests/sftp_server/start_on_docker.sh
388462
jobs:
@@ -435,9 +509,11 @@ blocks:
435509
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
436510
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
437511
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
512+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
438513
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
439514
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
440515
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
516+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
441517
- bash release/create.sh
442518
- apk add --update docker openrc
443519
- source tests/sftp_server/start_on_docker.sh
@@ -484,9 +560,11 @@ blocks:
484560
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
485561
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
486562
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
563+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
487564
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
488565
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
489566
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
567+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
490568
- bash release/create.sh
491569
- source tests/sftp_server/start_on_linux.sh
492570
- sudo apt-get install -y python3.8-dev
@@ -606,9 +684,11 @@ blocks:
606684
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
607685
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
608686
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
687+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
609688
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
610689
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
611690
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
691+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
612692
- bash release/create.sh
613693
- source release/install_in_tests.sh
614694
- git submodule init && git submodule update
@@ -640,9 +720,11 @@ blocks:
640720
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
641721
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
642722
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
723+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
643724
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
644725
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
645726
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
727+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
646728
- bash release/create.sh
647729
- source release/install_in_tests.sh
648730
- git submodule init && git submodule update
@@ -666,9 +748,11 @@ after_pipeline:
666748
- artifact pull workflow bin/linux/amd64/cache -d cache-cli/bin/linux/amd64/cache
667749
- artifact pull workflow bin/linux/arm64/cache -d cache-cli/bin/linux/arm64/cache
668750
- artifact pull workflow bin/darwin/amd64/cache -d cache-cli/bin/darwin/amd64/cache
751+
- artifact pull workflow bin/darwin/arm64/cache -d cache-cli/bin/darwin/arm64/cache
669752
- artifact pull workflow bin/linux/amd64/sem-context -d sem-context/bin/linux/amd64/sem-context
670753
- artifact pull workflow bin/linux/arm64/sem-context -d sem-context/bin/linux/arm64/sem-context
671754
- artifact pull workflow bin/darwin/amd64/sem-context -d sem-context/bin/darwin/amd64/sem-context
755+
- artifact pull workflow bin/darwin/arm64/sem-context -d sem-context/bin/darwin/arm64/sem-context
672756
- bash release/create.sh
673757
- source release/install_in_tests.sh
674758
- test-results gen-pipeline-report

release/create.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,17 @@ hosted::create_initial_content() {
7878
rm -rf /tmp/Linux
7979
rm -rf /tmp/Linux-arm
8080
rm -rf /tmp/Darwin
81+
rm -rf /tmp/Darwin-arm
8182

8283
mkdir -p /tmp/Linux/toolbox
8384
mkdir -p /tmp/Linux-arm/toolbox
8485
mkdir -p /tmp/Darwin/toolbox
86+
mkdir -p /tmp/Darwin-arm/toolbox
8587

8688
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Linux/toolbox
8789
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Linux-arm/toolbox
8890
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Darwin/toolbox
91+
cp -R ~/$SEMAPHORE_GIT_DIR/* /tmp/Darwin-arm/toolbox
8992

9093
exclusions=(
9194
.git
@@ -106,6 +109,7 @@ hosted::create_initial_content() {
106109
rm -rf /tmp/Linux/toolbox/${exclusion}
107110
rm -rf /tmp/Linux-arm/toolbox/${exclusion}
108111
rm -rf /tmp/Darwin/toolbox/${exclusion}
112+
rm -rf /tmp/Darwin-arm/toolbox/${exclusion}
109113
done
110114
}
111115

@@ -193,17 +197,21 @@ hosted::pack() {
193197
include_external_linux_binary $ARTIFACT_CLI_URL "artifact" /tmp/Linux "x86_64"
194198
include_external_linux_binary $ARTIFACT_CLI_URL "artifact" /tmp/Linux-arm "arm64"
195199
include_external_darwin_binary $ARTIFACT_CLI_URL "artifact" /tmp/Darwin "x86_64"
200+
include_external_darwin_binary $ARTIFACT_CLI_URL "artifact" /tmp/Darwin-arm "arm64"
196201
include_external_linux_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Linux "x86_64"
197202
include_external_linux_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Linux-arm "arm64"
198203
include_external_darwin_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Darwin "x86_64"
204+
include_external_darwin_binary $TEST_RESULTS_CLI_URL "test-results" /tmp/Darwin-arm "arm64"
199205
include_external_linux_binary $SPC_CLI_URL "spc" /tmp/Linux "x86_64"
200206
include_external_linux_binary $SPC_CLI_URL "spc" /tmp/Linux-arm "arm64"
201207
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/linux/amd64/cache /tmp/Linux/toolbox/cache
202208
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/linux/arm64/cache /tmp/Linux-arm/toolbox/cache
203209
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/darwin/amd64/cache /tmp/Darwin/toolbox/cache
210+
cp ~/$SEMAPHORE_GIT_DIR/cache-cli/bin/darwin/arm64/cache /tmp/Darwin-arm/toolbox/cache
204211
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/linux/amd64/sem-context /tmp/Linux/toolbox/sem-context
205212
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/linux/arm64/sem-context /tmp/Linux-arm/toolbox/sem-context
206213
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/darwin/amd64/sem-context /tmp/Darwin/toolbox/sem-context
214+
cp ~/$SEMAPHORE_GIT_DIR/sem-context/bin/darwin/arm64/sem-context /tmp/Darwin-arm/toolbox/sem-context
207215
cp /tmp/when-cli/when /tmp/Linux/toolbox/when
208216
cp /tmp/when-cli/when /tmp/Linux-arm/toolbox/when
209217
}
@@ -233,6 +241,8 @@ create_tarball "linux.tar" /tmp/Linux
233241
echo "$(create_checksum /tmp/Linux/linux.tar 'linux.tar')" >> /tmp/checksums.txt
234242
create_tarball "darwin.tar" /tmp/Darwin
235243
echo "$(create_checksum /tmp/Darwin/darwin.tar 'darwin.tar')" >> /tmp/checksums.txt
244+
create_tarball "darwin-arm.tar" /tmp/Darwin-arm
245+
echo "$(create_checksum /tmp/Darwin-arm/darwin.tar 'darwin-arm.tar')" >> /tmp/checksums.txt
236246
create_tarball "linux-arm.tar" /tmp/Linux-arm
237247
echo "$(create_checksum /tmp/Linux-arm/linux-arm.tar 'linux-arm.tar')" >> /tmp/checksums.txt
238248

release/install_in_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ cd ~
2222
arch=""
2323
case $(uname) in
2424
Darwin)
25-
tar -xvf /tmp/Darwin/darwin.tar -C /tmp
25+
[[ "$(uname -m)" =~ "arm64" ]] && arch="-arm"
26+
tar -xvf /tmp/Darwin${arch}/darwin${arch}.tar -C /tmp
2627
mv /tmp/toolbox ~/.toolbox
2728
;;
2829
Linux)

release/upload.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -euo pipefail
1010
# - /tmp/Linux/linux.tar
1111
# - /tmp/Linux/linux-arm.tar
1212
# - /tmp/Darwin/darwin.tar
13+
# - /tmp/Darwin/darwin-arm.tar
1314
# - /tmp/self-hosted-Linux/linux.tar
1415
# - /tmp/self-hosted-Linux-arm/linux-arm.tar
1516
# - /tmp/self-hosted-Darwin/darwin.tar
@@ -79,6 +80,17 @@ curl \
7980

8081
echo "darwin.tar uploaded"
8182

83+
curl \
84+
-X POST \
85+
-H "Authorization: token $GITHUB_TOKEN" \
86+
-H "Accept: application/vnd.github.v3+json" \
87+
-H "Content-Type: $(file -b --mime-type /tmp/Darwin/darwin-arm.tar)" \
88+
--data-binary @/tmp/Darwin/darwin.tar \
89+
"https://uploads.github.com/repos/semaphoreci/toolbox/releases/$release_id/assets?name=darwin-arm.tar"
90+
91+
echo "darwin-arm.tar uploaded"
92+
93+
8294
curl \
8395
-X POST \
8496
-H "Authorization: token $GITHUB_TOKEN" \

0 commit comments

Comments
 (0)