Skip to content

Commit 9d61f4d

Browse files
snoybergborsboom
authored andcommitted
Add a GitHub Actions workflow for ARM64
1 parent 3637641 commit 9d61f4d

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

.github/workflows/arm64-release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: ARM64 Release
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- stable
9+
- rc/**
10+
tags:
11+
- '**'
12+
workflow_dispatch:
13+
14+
jobs:
15+
arm64:
16+
name: Publish bindist
17+
runs-on: [self-hosted, linux, ARM64]
18+
steps:
19+
- name: Clone project
20+
uses: actions/checkout@v2
21+
- shell: bash
22+
run: |
23+
set -ex
24+
25+
docker build . -f etc/dockerfiles/arm64.Dockerfile -t stack --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g)
26+
rm -rf _release
27+
mkdir -p _release
28+
docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
29+
30+
- name: Upload bindist
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: Linux-ARM64
34+
path: _release/stack-*

etc/dockerfiles/arm64.Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM ubuntu:20.04
2+
3+
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
4+
curl build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 libnuma-dev xz-utils \
5+
g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev git gnupg netbase
6+
7+
RUN cd /tmp && \
8+
curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang+llvm-9.0.1-aarch64-linux-gnu.tar.xz --output /tmp/llvm.tar.xz && \
9+
unxz /tmp/llvm.tar.xz && \
10+
tar xfv /tmp/llvm.tar --strip-components 1 -C /usr && \
11+
rm /tmp/llvm.tar
12+
13+
RUN curl -sSL https://github.com/commercialhaskell/stack/releases/download/v2.7.1/stack-2.7.1-linux-aarch64.bin > /usr/local/bin/stack && \
14+
chmod +x /usr/local/bin/stack
15+
16+
ARG USERID
17+
ARG GROUPID
18+
19+
RUN useradd --uid $USERID stack && mkdir -p /home/stack && chown -R stack /home/stack && usermod -aG $GROUPID stack
20+
USER stack
21+
WORKDIR /home/stack
22+
23+
RUN stack setup ghc-8.10.4
24+
RUN stack update
25+
26+
COPY stack.yaml package.yaml /src/
27+
USER root
28+
RUN chown -R stack /src
29+
USER stack
30+
RUN cd /src && stack build --only-snapshot --test && stack build shake
31+
32+
COPY etc/scripts/release.hs /src
33+
RUN stack script --resolver lts-17.10 --compile /src/release.hs -- --version && cp /src/release /home/stack

etc/scripts/release.hs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import Distribution.Text
3636
import Distribution.System
3737
import Distribution.Package
3838
import Distribution.PackageDescription hiding (options)
39+
#if MIN_VERSION_Cabal(3, 0, 0)
40+
import Distribution.Utils.ShortText (fromShortText)
41+
#endif
3942
import Distribution.Verbosity
4043
import System.Console.GetOpt
4144
import System.Directory
@@ -50,6 +53,11 @@ import Development.Shake
5053
import Development.Shake.FilePath
5154
import Prelude -- Silence AMP warning
5255

56+
#if !MIN_VERSION_Cabal(3, 0, 0)
57+
fromShortText :: String -> String
58+
fromShortText = id
59+
#endif
60+
5361
-- | Entrypoint.
5462
main :: IO ()
5563
main =
@@ -214,8 +222,8 @@ rules global@Global{..} args = do
214222
(command_ [] "c:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Bin\\signtool.exe"
215223
["sign"
216224
,"/v"
217-
,"/d", synopsis gStackPackageDescription
218-
,"/du", homepage gStackPackageDescription
225+
,"/d", fromShortText $ synopsis gStackPackageDescription
226+
,"/du", fromShortText $ homepage gStackPackageDescription
219227
,"/n", certName
220228
,"/t", "http://timestamp.verisign.com/scripts/timestamp.dll"
221229
,out])

0 commit comments

Comments
 (0)