-
Notifications
You must be signed in to change notification settings - Fork 53
72 lines (57 loc) · 2.07 KB
/
linux-static-binary.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build Linux static binary
on:
workflow_dispatch:
inputs:
ref:
description: "the repository ref to build"
required: true
default: "main"
env:
STACK_VERSION: 2.11.1
jobs:
build:
name: Build static binary
runs-on: ubuntu-latest
container: docker.io/benz0li/ghc-musl@sha256:0c491f49df224947847084159c85f60590c4c0324ecdf0efb366f82ed3b20023
steps:
- name: checkout code
uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.inputs.ref }}
- name: create ~/.local/bin
run: mkdir -p "$HOME/.local/bin"
shell: bash
- name: Add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
- name: install stack
run: |
TAR_BASE_NAME=stack-$STACK_VERSION-linux-x86_64-static
TAR_FILE_NAME=$TAR_BASE_NAME.tar.gz
curl https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/$TAR_FILE_NAME -OL
tar xf $TAR_FILE_NAME
cp $TAR_BASE_NAME/stack /usr/local/bin
- name: Stack permissions bug workaround
run: "chown -R $(id -un):$(id -gn) ~"
# Without this the git command used by githash TemplateHaskell fails with permission error
# https://github.com/anoma/juvix/issues/2294
- name: Git permissions workaround
run: "chown -R $(id -un):$(id -gn) ."
- name: Install cargo
run: apk add --update cargo
- name: Install clang
run: apk add --update clang
- name: Install llvm
run: apk add --update llvm
- name: Runtime build
run: make runtime LIBTOOL=llvm-ar
- name: build Juvix
run: stack install --allow-different-user --system-ghc --ghc-options='-split-sections' --flag juvix:static
- run: echo "HOME=$HOME" >> $GITHUB_ENV
shell: bash
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: juvix-linux_x86_64-${{ github.event.inputs.ref }}
path: ${{ env.HOME }}/.local/bin/juvix