Skip to content

Commit f3e28bd

Browse files
committed
Update release CI
1 parent 7540878 commit f3e28bd

File tree

1 file changed

+77
-101
lines changed

1 file changed

+77
-101
lines changed

.github/workflows/integration-tests.yml

Lines changed: 77 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
name: Integration tests
22

33
on:
4-
pull_request:
54
push:
6-
branches:
7-
- master
8-
- stable
9-
- rc/**
105
tags:
116
- '**'
127
workflow_dispatch:
138

14-
# Stack will use the value of the GH_TOKEN environment variable to authenticate
15-
# its requests of the GitHub REST API, providing a higher request rate limit.
16-
env:
17-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
199
# As of 6 May 2024, ubuntu-latest and windows-latest come with Stack 2.15.5 and
2010
# GHC 9.8.2. However, macos-13 and macos-latest do not come with Haskell tools.
2111
# windows-latest comes with NSIS 3.08, for which the default value of the
@@ -160,79 +150,90 @@ jobs:
160150
name: ${{ runner.os }}-${{ runner.arch }}
161151
path: _release/stack-*
162152

163-
configuration:
164-
name: Check for self-hosted runners
165-
runs-on: ubuntu-latest
166-
env:
167-
CAN_SIGN: ${{ secrets.RELEASE_SIGNING_KEY != '' }}
168-
outputs:
169-
arm64-runner: ${{ steps.runners.outputs.arm64 }}
170-
can-sign: ${{ env.CAN_SIGN }}
171-
test-arm64: ${{ steps.runners.outputs.test-arm64 }}
172-
steps:
173-
- name: Check for hosted runners
174-
id: runners
175-
shell: bash
176-
env:
177-
SELF_HOSTED_RUNNERS: ${{ secrets.SELF_HOSTED_RUNNERS || (github.repository_owner == 'commercialhaskell' && 'arm64') }}
178-
run: |
179-
echo "runners=$SELF_HOSTED_RUNNERS" >> $GITHUB_OUTPUT
180-
if echo "$SELF_HOSTED_RUNNERS" | grep -q 'arm64'; then
181-
echo "arm64=['self-hosted', 'linux', 'ARM64']" >> $GITHUB_OUTPUT
182-
echo "test-arm64=true" >> $GITHUB_OUTPUT
183-
else
184-
echo "arm64='ubuntu-latest'" >> $GITHUB_OUTPUT
185-
echo "test-arm64=false" >> $GITHUB_OUTPUT
186-
fi
187-
188153
linux-arm64:
189154
name: Linux ARM64
190-
runs-on: ${{ fromJSON(needs.configuration.outputs.arm64-runner) }}
191-
needs: configuration
155+
runs-on: [self-hosted, Linux, ARM64, maerwald]
156+
strategy:
157+
fail-fast: false
158+
matrix:
159+
include:
160+
- container: hasufell/arm64v8-alpine-haskell:3.20
161+
release-args: "--alpine"
162+
install-cmd: "apk update && apk add --no-cache nodejs"
163+
container:
164+
image: ${{ matrix.container }}
192165
steps:
193-
- name: Skipping ARM64
194-
if: needs.configuration.outputs.test-arm64 == 'false'
195-
shell: bash
196-
run: |
197-
echo '::notice title=ARM64 skipped::To build ARM64, a self-hosted runner needs to be configured and the SELF_HOSTED_RUNNERS secret must contain arm64'
198-
- name: Clone project
199-
if: needs.configuration.outputs.test-arm64 == 'true'
200-
uses: actions/checkout@v4
201-
- name: Install deps
202-
shell: bash
203-
run: |
204-
set -ex
166+
- name: Install node
167+
run: ${{ matrix.install-cmd }}
205168

206-
# As of 9 December 2024, the self-hosted runner comes with Stack 3.1.1,
207-
# but it is not on the PATH. Logging the version for information.
208-
/usr/local/bin/stack --version
169+
- name: Checkout code
170+
uses: actions/checkout@v4
171+
with:
172+
submodules: 'true'
209173

210-
set +ex
211-
- name: Build bindist
212-
if: needs.configuration.outputs.test-arm64 == 'true'
213-
shell: bash
214-
run: |
215-
# Stack's project-level configuration (stack.yaml) specifies the
216-
# multi-architecture (including Linux/Aarch64) Docker image published by
217-
# Oliver Benz (@benz0li, on GitHub). That image comes with Stack 3.1.1.
218-
# (Note that the online documentation for '--docker-stack-exe image'
219-
# specifies that the host Stack and image Stack must have the same
220-
# version number.)
221-
/usr/local/bin/stack etc/scripts/release.hs build --alpine --stack-args --docker-stack-exe=image
174+
- uses: haskell/ghcup-setup@v1
222175

223-
- name: Upload bindist
224-
if: needs.configuration.outputs.test-arm64 == 'true'
225-
uses: actions/upload-artifact@v4
226-
with:
227-
name: Linux-ARM64
228-
path: _release/stack-*
176+
- name: Run build (aarch64 linux)
177+
run: |
178+
ghcup config set gpg-setting GPGNone
179+
export CABAL_DIR="$GITHUB_WORKSPACE/cabal"
180+
export STACK_ROOT="${GITHUB_WORKSPACE}"/.stack
181+
mkdir -p $STACK_ROOT/hooks/
182+
curl https://raw.githubusercontent.com/haskell/ghcup-hs/master/scripts/hooks/stack/ghc-install.sh > $STACK_ROOT/hooks/ghc-install.sh
183+
chmod +x $STACK_ROOT/hooks/ghc-install.sh
184+
stack config set system-ghc false --global
185+
ghcup -s https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-vanilla-0.0.8.yaml run --install --stack=latest -- stack --allow-different-user etc/scripts/release.hs build --allow-dirty ${{ matrix.release-args }} --stack-args --docker-stack-exe=image
186+
187+
- name: Upload bindist
188+
uses: actions/upload-artifact@v4
189+
with:
190+
name: Linux-ARM64
191+
path: _release/stack-*
192+
193+
freebsd-x64:
194+
name: FreeBSD X64
195+
runs-on: [self-hosted, FreeBSD, X64]
196+
steps:
197+
- name: Checkout code
198+
uses: actions/checkout@v4
199+
with:
200+
submodules: 'true'
201+
202+
- name: Install prerequisites
203+
run: |
204+
sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
205+
sudo pkg install -y ghc gcc curl git bash misc/compat10x misc/compat11x misc/compat12x gmake libiconv devel/stack
206+
sudo tzsetup Etc/GMT
207+
sudo adjkerntz -a
208+
209+
- uses: haskell/ghcup-setup@v1
210+
211+
- name: Install stack ghcup hook
212+
run: |
213+
set -eux
214+
ghcup install stack --set latest
215+
export STACK_ROOT="${GITHUB_WORKSPACE}"/.stack
216+
mkdir -p $STACK_ROOT/hooks/
217+
curl https://raw.githubusercontent.com/haskell/ghcup-hs/master/scripts/hooks/stack/ghc-install.sh > $STACK_ROOT/hooks/ghc-install.sh
218+
chmod +x $STACK_ROOT/hooks/ghc-install.sh
219+
stack config set system-ghc false --global
220+
221+
- name: Run build
222+
run: |
223+
export STACK_ROOT="${GITHUB_WORKSPACE}"/.stack
224+
export CABAL_DIR="$GITHUB_WORKSPACE/cabal"
225+
stack etc/scripts/release.hs build --allow-dirty
226+
- name: Upload bindist
227+
uses: actions/upload-artifact@v4
228+
with:
229+
name: FreeBSD-X64
230+
path: _release/stack-*
229231

230232
github-release:
231233
name: Create GitHub release
232234
permissions:
233235
contents: write
234236
needs:
235-
- configuration
236237
- integration-tests
237238
- linux-arm64
238239
runs-on: ubuntu-latest
@@ -259,27 +260,25 @@ jobs:
259260
name: Windows-X64
260261
path: _release
261262
- name: Download Linux/AArch64 artifact
262-
if: needs.configuration.outputs.test-arm64 == 'true'
263263
uses: actions/download-artifact@v4
264264
with:
265265
name: Linux-ARM64
266266
path: _release
267+
- name: Download FreeBSD/X64 artifact
268+
uses: actions/download-artifact@v4
269+
with:
270+
name: FreeBSD-X64
271+
path: _release
267272
- name: Hash and sign assets
268-
if: needs.configuration.outputs.can-sign == 'true'
269273
shell: bash
270-
env:
271-
RELEASE_SIGNING_KEY: ${{ secrets.RELEASE_SIGNING_KEY }}
272274
run: |
273275
set -e
274-
echo "$RELEASE_SIGNING_KEY"|gpg --import
275276
cd _release
276277
for asset in *; do
277278
shasum -a 256 "$asset" >"$asset.sha256"
278-
gpg --digest-algo=sha512 --detach-sig --armor -u 0x575159689BEFB442 "$asset"
279279
done
280280
- name: Create GitHub release (final)
281281
id: github_release_final
282-
if: "!startsWith(github.ref, 'refs/tags/rc/')"
283282
uses: ncipollo/[email protected]
284283
env:
285284
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -296,19 +295,7 @@ jobs:
296295
[INSERT CONTRIBUTORS]
297296
draft: true
298297
prerelease: false
299-
- name: Create GitHub release (release candidate)
300-
id: github_release_rc
301-
if: "startsWith(github.ref, 'refs/tags/rc/')"
302-
uses: ncipollo/[email protected]
303-
env:
304-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
305-
with:
306-
body: |
307-
**Changes since v[INSERT PREVIOUS VERSION]:**
308298

309-
[INSERT CHANGELOG]
310-
draft: true
311-
prerelease: true
312299
- name: Upload assets to GitHub release (final)
313300
if: "!startsWith(github.ref, 'refs/tags/rc/')"
314301
uses: xresloader/upload-to-github-release@v1
@@ -320,14 +307,3 @@ jobs:
320307
prerelease: false
321308
overwrite: true
322309
release_id: ${{ steps.github_release_final.outputs.id }}
323-
- name: Upload assets to GitHub release (release candidate)
324-
if: "startsWith(github.ref, 'refs/tags/rc/')"
325-
uses: xresloader/upload-to-github-release@v1
326-
env:
327-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
328-
with:
329-
file: "_release/*"
330-
draft: true
331-
prerelease: true
332-
overwrite: true
333-
release_id: ${{ steps.github_release_rc.outputs.id }}

0 commit comments

Comments
 (0)