Skip to content

Commit df601b3

Browse files
committed
Wiggle
1 parent 04a8051 commit df601b3

2 files changed

Lines changed: 123 additions & 121 deletions

File tree

.github/scripts/build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ binary_opttest=$(cabal --project-file=cabal.project.release list-bin ghcup-optpa
3232
ver=$("${binary}" --numeric-version)
3333
strip_binary "${binary}"
3434

35+
# linking info
3536
if [ "${OS}" = "macOS" ] ; then
36-
otool -L "${binary}" | grep libyaml && { echo "undesired libyaml linking" ; exit 5 ; }
37+
otool -L "${binary}"
38+
otool -L "${binary}" | grep libyaml && { echo "undesired libyaml linking" ; exit 5 ; }
39+
else
40+
ldd "${binary}"
3741
fi
3842

3943
cp "${binary}" "out/${ARTIFACT}-${ver}${ext}"

.github/workflows/release.yaml

Lines changed: 118 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ env:
1818
JSON_VERSION: "0.0.9"
1919
GHC_VER: 9.6.7
2020
CABAL_VER: 3.14.2.0
21+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
22+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
23+
S3_HOST: ${{ secrets.S3_HOST }}
24+
GHCUP_MSYS2_ENV: CLANG64
25+
MSYSTEM: CLANG64
26+
CHERE_INVOKING: 1
2127

2228
jobs:
2329
build-linux:
2430
name: Build linux binary
2531
runs-on: ${{ matrix.os }}
26-
env:
27-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
29-
S3_HOST: ${{ secrets.S3_HOST }}
3032
strategy:
3133
fail-fast: true
3234
matrix:
@@ -82,18 +84,11 @@ jobs:
8284
8385
build-arm:
8486
name: Build ARM binary
85-
runs-on: ${{ matrix.os }}
87+
runs-on: ubuntu-24.04-arm
8688
env:
87-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
88-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
89-
S3_HOST: ${{ secrets.S3_HOST }}
90-
strategy:
91-
matrix:
92-
include:
93-
- os: [self-hosted, Linux, ARM64, maerwald]
94-
ARTIFACT: "aarch64-linux-ghcup"
95-
ARCH: ARM64
96-
DISTRO: Alpine
89+
ARTIFACT: "aarch64-linux-ghcup"
90+
ARCH: ARM64
91+
DISTRO: Alpine
9792
steps:
9893
- name: git config
9994
run: |
@@ -105,49 +100,36 @@ jobs:
105100
with:
106101
submodules: 'true'
107102

108-
- if: matrix.ARCH == 'ARM64'
109-
uses: docker://hasufell/arm64v8-alpine-haskell:3.21
103+
- uses: docker://hasufell/arm64v8-alpine-haskell:3.21
110104
name: Run build (aarch64 linux)
111105
with:
112106
args: sh -c ".github/scripts/build.sh '--ghc-options=-split-sections' '--enable-executable-static'"
113-
env:
114-
ARTIFACT: ${{ matrix.ARTIFACT }}
115-
ARCH: ${{ matrix.ARCH }}
116-
DISTRO: ${{ matrix.DISTRO }}
117-
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
118-
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
119-
S3_HOST: ${{ env.S3_HOST }}
120107

121108
- if: always()
122109
name: Upload artifact
123110
uses: actions/upload-artifact@v4
124111
with:
125-
name: artifacts-${{ matrix.ARTIFACT }}
112+
name: artifacts-${{ env.ARTIFACT }}
126113
path: |
127114
./out/*
128115
129-
build-macwin:
130-
name: Build binary (Mac/Win)
116+
build-mac:
117+
name: Build binary (Mac)
131118
runs-on: ${{ matrix.os }}
132119
env:
133120
MACOSX_DEPLOYMENT_TARGET: 10.13
134-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
135-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
136-
S3_HOST: ${{ secrets.S3_HOST }}
137121
LLVM_VER: 16
122+
DISTRO: na
138123
strategy:
139124
fail-fast: false
140125
matrix:
141126
include:
142-
- os: [self-hosted, macOS, ARM64]
127+
- os: macOS-latest
143128
ARTIFACT: "aarch64-apple-darwin-ghcup"
144129
ARCH: ARM64
145130
- os: macOS-15-intel
146131
ARTIFACT: "x86_64-apple-darwin-ghcup"
147132
ARCH: 64
148-
- os: windows-latest
149-
ARTIFACT: "x86_64-mingw64-ghcup"
150-
ARCH: 64
151133
steps:
152134
- name: Checkout code
153135
uses: actions/checkout@v4
@@ -157,64 +139,66 @@ jobs:
157139
- name: Install GHCup
158140
uses: haskell/ghcup-setup@v1
159141

160-
- if: matrix.ARCH == 'ARM64' && runner.os == 'macOS'
161-
name: Run build (mac aarch64)
142+
- name: Run build (mac aarch64)
162143
run: |
163-
bash .github/scripts/brew.sh git coreutils autoconf automake
164-
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
144+
brew install git coreutils autoconf automake
165145
bash .github/scripts/build.sh
166146
env:
167147
ARTIFACT: ${{ matrix.ARTIFACT }}
168148
ARCH: ${{ matrix.ARCH }}
169-
DISTRO: na
170-
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
171-
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
172-
S3_HOST: ${{ env.S3_HOST }}
173-
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
174149

175-
- if: matrix.ARCH == '64' && runner.os == 'macOS'
176-
name: Run build (mac x86_64)
177-
run: |
178-
bash .github/scripts/brew.sh coreutils
179-
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
180-
bash .github/scripts/build.sh
150+
- if: always()
151+
name: Upload artifact
152+
uses: actions/upload-artifact@v4
153+
with:
154+
name: artifacts-${{ matrix.ARTIFACT }}
155+
path: |
156+
./out/*
157+
158+
build-win:
159+
name: Build binary (Windows)
160+
runs-on: windows-latest
161+
env:
162+
ARTIFACT: "x86_64-mingw64-ghcup"
163+
ARCH: 64
164+
DISTRO: na
165+
GHCUP_INSTALL_BASE_PREFIX: "C:\\"
166+
defaults:
167+
run:
168+
shell: 'C:/msys64/usr/bin/bash.exe --login -e {0}'
169+
steps:
170+
- name: Checkout code
171+
uses: actions/checkout@v4
172+
with:
173+
submodules: 'true'
174+
175+
- name: Install GHCup
176+
uses: haskell/ghcup-setup@v1
181177
env:
182-
ARTIFACT: ${{ matrix.ARTIFACT }}
183-
ARCH: ${{ matrix.ARCH }}
184-
DISTRO: na
185-
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
186-
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
187-
S3_HOST: ${{ env.S3_HOST }}
188-
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
178+
GHCUP_MSYS2: 'C:/msys64'
189179

190-
- if: runner.os == 'Windows'
191-
name: Run build (windows)
180+
- name: Install msys2 dependencies
181+
run: &msys2-install |
182+
pacman --noconfirm -S --needed --overwrite '*' bash winpty git tar bsdtar unzip binutils autoconf make xz curl libtool automake p7zip patch ca-certificates python3 zip mingw-w64-clang-x86_64-toolchain mingw-w64-clang-x86_64-tools-git gzip mingw-w64-clang-x86_64-pkgconf mingw-w64-clang-x86_64-zlib
183+
184+
- name: Run build (windows)
192185
run: |
186+
rm -f /c/Strawberry/perl/bin/pkg-config
187+
rm /clang64/bin/zlib1.dll
193188
bash .github/scripts/build.sh
194-
env:
195-
ARTIFACT: ${{ matrix.ARTIFACT }}
196-
ARCH: ${{ matrix.ARCH }}
197-
DISTRO: na
198-
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
199-
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
200-
S3_HOST: ${{ env.S3_HOST }}
201-
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
202189
203190
- if: always()
204191
name: Upload artifact
205192
uses: actions/upload-artifact@v4
206193
with:
207-
name: artifacts-${{ matrix.ARTIFACT }}
194+
name: artifacts-${{ env.ARTIFACT }}
208195
path: |
209196
./out/*
210197
211198
build-freebsd:
212199
name: Build binary (FreeBSD)
213200
runs-on: [self-hosted, FreeBSD, X64]
214201
env:
215-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
216-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
217-
S3_HOST: ${{ secrets.S3_HOST }}
218202
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
219203
ARCH: 64
220204
DISTRO: na
@@ -354,15 +338,11 @@ jobs:
354338
test-arm:
355339
name: Test ARM
356340
needs: "build-arm"
357-
runs-on: ${{ matrix.os }}
358-
strategy:
359-
matrix:
360-
include:
361-
- os: [self-hosted, Linux, ARM64, maerwald]
362-
ARTIFACT: "aarch64-linux-ghcup"
363-
ARCH: ARM64
364-
DISTRO: Alpine
365-
341+
runs-on: ubuntu-24.04-arm
342+
env:
343+
ARTIFACT: "aarch64-linux-ghcup"
344+
ARCH: ARM64
345+
DISTRO: Alpine
366346
steps:
367347
- name: Checkout code
368348
uses: actions/checkout@v4
@@ -375,46 +355,35 @@ jobs:
375355
merge-multiple: true
376356
path: ./out
377357

378-
- if: matrix.ARCH == 'ARM64'
379-
uses: docker://hasufell/arm64v8-alpine-haskell:3.21
358+
- uses: docker://hasufell/arm64v8-alpine-haskell:3.21
380359
name: Run test (aarch64 alpine)
381360
with:
382361
args: sh .github/scripts/test.sh
383-
env:
384-
ARTIFACT: ${{ matrix.ARTIFACT }}
385-
ARCH: ${{ matrix.ARCH }}
386-
DISTRO: ${{ matrix.DISTRO }}
387362

388363
- if: failure()
389364
name: Upload artifact
390365
uses: actions/upload-artifact@v4
391366
with:
392-
name: testfiles-${{ matrix.ARTIFACT }}
367+
name: testfiles-${{ env.ARTIFACT }}
393368
path: |
394369
./test/ghcup-test/golden/unix/GHCupInfo*json
395370
396-
test-macwin:
397-
name: Test Mac/Win
398-
needs: "build-macwin"
371+
test-mac:
372+
name: Test Mac
373+
needs: "build-mac"
399374
runs-on: ${{ matrix.os }}
400375
env:
401376
MACOSX_DEPLOYMENT_TARGET: 10.13
377+
DISTRO: na
402378
strategy:
403379
matrix:
404380
include:
405-
- os: [self-hosted, macOS, ARM64]
381+
- os: macOS-latest
406382
ARTIFACT: "aarch64-apple-darwin-ghcup"
407383
ARCH: ARM64
408-
DISTRO: na
409384
- os: macOS-15-intel
410385
ARTIFACT: "x86_64-apple-darwin-ghcup"
411386
ARCH: 64
412-
DISTRO: na
413-
- os: windows-latest
414-
ARTIFACT: "x86_64-mingw64-ghcup"
415-
ARCH: 64
416-
DISTRO: na
417-
418387
steps:
419388
- name: Checkout code
420389
uses: actions/checkout@v4
@@ -430,42 +399,71 @@ jobs:
430399
merge-multiple: true
431400
path: ./out
432401

433-
- if: runner.os == 'macOS'
434-
name: Run test (mac)
402+
- name: Run test (mac)
435403
run: |
436-
bash .github/scripts/brew.sh coreutils
437-
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
404+
brew install coreutils
438405
bash .github/scripts/test.sh
439406
env:
440407
ARTIFACT: ${{ matrix.ARTIFACT }}
441408
ARCH: ${{ matrix.ARCH }}
442-
DISTRO: ${{ matrix.DISTRO }}
443-
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
444409

445-
- if: runner.os != 'macOS'
446-
name: Run test (windows)
447-
run: bash .github/scripts/test.sh
448-
env:
449-
ARTIFACT: ${{ matrix.ARTIFACT }}
450-
ARCH: ${{ matrix.ARCH }}
451-
DISTRO: ${{ matrix.DISTRO }}
452-
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
453-
454-
- if: failure() && runner.os == 'Windows'
455-
name: Upload artifact
410+
- name: Upload artifact
456411
uses: actions/upload-artifact@v4
457412
with:
458413
name: testfiles-${{ matrix.ARTIFACT }}
459414
path: |
460-
./test/ghcup-test/golden/windows/GHCupInfo*json
415+
./test/ghcup-test/golden/unix/GHCupInfo*json
461416
462-
- if: failure() && runner.os != 'Windows'
463-
name: Upload artifact
417+
test-win:
418+
name: Test Win
419+
needs: "build-win"
420+
runs-on: windows-latest
421+
env:
422+
ARTIFACT: "x86_64-mingw64-ghcup"
423+
ARCH: 64
424+
DISTRO: na
425+
GHCUP_INSTALL_BASE_PREFIX: "C:\\"
426+
defaults:
427+
run:
428+
shell: 'C:/msys64/usr/bin/bash.exe --login -e {0}'
429+
steps:
430+
- name: Checkout code
431+
uses: actions/checkout@v4
432+
with:
433+
submodules: 'true'
434+
435+
- name: Install GHCup
436+
uses: haskell/ghcup-setup@v1
437+
env:
438+
GHCUP_MSYS2: 'C:/msys64'
439+
440+
- name: Install msys2 dependencies
441+
run: *msys2-install
442+
443+
- name: Run build (windows)
444+
run: |
445+
rm -f /c/Strawberry/perl/bin/pkg-config
446+
rm /clang64/bin/zlib1.dll
447+
bash .github/scripts/build.sh
448+
449+
- uses: actions/download-artifact@v4
450+
with:
451+
pattern: artifacts-*
452+
merge-multiple: true
453+
path: ./out
454+
455+
- name: Run test (windows)
456+
run: |
457+
rm -f /c/Strawberry/perl/bin/pkg-config
458+
rm /clang64/bin/zlib1.dll
459+
bash .github/scripts/test.sh
460+
461+
- name: Upload artifact
464462
uses: actions/upload-artifact@v4
465463
with:
466-
name: testfiles-${{ matrix.ARTIFACT }}
464+
name: testfiles-${{ env.ARTIFACT }}
467465
path: |
468-
./test/ghcup-test/golden/unix/GHCupInfo*json
466+
./test/ghcup-test/golden/windows/GHCupInfo*json
469467
470468
test-freebsd:
471469
name: Test FreeBSD
@@ -578,7 +576,7 @@ jobs:
578576
579577
release:
580578
name: release
581-
needs: ["test-linux", "test-arm", "test-macwin", "test-freebsd", "test-openbsd", "hls"]
579+
needs: ["test-linux", "test-arm", "test-mac", "test-win", "test-freebsd", "test-openbsd", "hls"]
582580
runs-on: ubuntu-latest
583581
if: startsWith(github.ref, 'refs/tags/v')
584582
steps:

0 commit comments

Comments
 (0)