-
Notifications
You must be signed in to change notification settings - Fork 1
147 lines (127 loc) · 6.1 KB
/
release-x86_64-pc-windows-mingw32.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: 'Build windows target for release'
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release ( ex: v0.0.1 )'
required: true
env:
node-version: 14.x
jobs:
release:
runs-on: windows-2019
steps:
- name: Checkout madlib
uses: actions/checkout@v2
# - name: Install Haskell tools
# run: |
# choco install ghc --version 8.10.7 -m -r
# choco install haskell-stack --version 2.7.3 -m -r
# choco install cabal --version 3.6.2.0 -m -r
- uses: haskell/actions/setup@v2
with:
ghc-version: "8.10.7"
cabal-version: "3.4.0.0"
stack-version: "2.7.3"
enable-stack: true
- name: Configure stack
run: stack config set system-ghc --global true
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
- name: Install rollup
run: npm i -g esbuild@v0.20.0
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
update: false
install: >-
git
mingw-w64-x86_64-curl
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-openssl
mingw-w64-x86_64-zlib
mingw-w64-x86_64-nasm
base-devel
msys2-devel
unzip
tar
- name: Install LLVM 12
run: |
echo "download archive"
curl -L https://github.com/madlib-lang/llvm-build-actions/releases/download/v0.0.2/llvm12-mingw64.zip --output LLVM.zip
echo "create folder"
mkdir LLVM
echo "move to folder"
cd LLVM
echo "unzip archive"
unzip ../LLVM.zip
echo "exit folder"
cd ..
echo "clean up LLVM folder"
rm -rf "/c/Program Files/LLVM"
echo "move LLVM folder"
mv LLVM "/c/Program Files/"
ls -l "/c/Program Files/LLVM"
shell: msys2 {0}
- name: Update paths
run:
echo "PATH=c:\Program Files\LLVM\bin;D:\a\_temp\msys64\mingw64\bin;C:\npm\prefix;c:\Program Files\nodejs;c:\ProgramData\chocolatey\bin;c:\Users\runneradmin\AppData\Roaming\local\bin;c:\Users\runneradmin\AppData\Local\Programs\stack\x86_64-windows\ghc-8.10.7\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "PATH=c:\Program Files\LLVM\bin;D:\a\_temp\msys64\mingw64\bin;C:\npm\prefix;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install happy and alex
run: stack install alex happy
- name: Build madlib
run: stack build -v --flag madlib:static
# - name: Build madlib
# shell: msys2 {0}
# run: PATH="/c/Program Files/LLVM/bin:/mingw64/bin:/c/npm/prefix:/c/Program Files/nodejs:/c/ProgramData/chocolatey/bin:/c/Users/runneradmin/AppData/Roaming/local/bin:/c/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows/ghc-8.10.7/bin:$PATH" stack build -v --flag madlib:static
- name: Path info
shell: msys2 {0}
run: |
export PATH="/c/hostedtoolcache/windows/stack/2.7.3/x64:/c/tools/ghc-8.10.7/bin:/c/Users/runneradmin/AppData/Roaming/cabal/bin:/c/npm/prefix:/c/Program Files/nodejs:/c/ProgramData/chocolatey/bin:/c/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows/ghc-8.10.7/bin:$PATH"
pwd
ls -la
ls -l "$(stack path --dist-dir)"
ls -l "$(stack path --dist-dir)/build/"
ls -l "$(stack path --dist-dir)/build/madlib/"
- name: Build tools
shell: msys2 {0}
run: |
export PATH="/c/hostedtoolcache/windows/stack/2.7.3/x64:/c/tools/ghc-8.10.7/bin:/c/Users/runneradmin/AppData/Roaming/cabal/bin:/c/npm/prefix:/c/Program Files/nodejs:/c/ProgramData/chocolatey/bin:/c/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows/ghc-8.10.7/bin:$PATH"
export ESBUILD_PATH="/c/npm/prefix/esbuild.cmd"
"$(stack path --dist-dir)/build/madlib/madlib" compile -i tools/package-installer/src/Main.mad -o ./tools/package-installer/dist/package-installer.js --bundle
- name: Override LLVM path
run: echo "PATH=D:\a\_temp\msys64\mingw64\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build runtime
shell: msys2 {0}
run: |
pacman --noconfirm -S mingw-w64-x86_64-llvm mingw-w64-x86_64-clang mingw-w64-x86_64-gcc mingw-w64-x86_64-libc++ mingw-w64-x86_64-libc++abi
TARGET="WIN_X64" ./scripts/build-runtime-libs
TARGET="WIN_X64" CXX="g++" ./scripts/build-runtime
- name: Bundle archive
shell: msys2 {0}
run: |
export PATH="/c/hostedtoolcache/windows/stack/2.7.3/x64:/c/tools/ghc-8.10.7/bin:/c/Users/runneradmin/AppData/Roaming/cabal/bin:/c/npm/prefix:/c/Program Files/nodejs:/c/ProgramData/chocolatey/bin:/c/Users/runneradmin/AppData/Local/Programs/stack/x86_64-windows/ghc-8.10.7/bin:$PATH"
mkdir madlib-x86_64-pc-windows-mingw32
cp "$(stack path --dist-dir)/build/madlib/madlib.exe" ./madlib-x86_64-pc-windows-mingw32/
cp -R runtime ./madlib-x86_64-pc-windows-mingw32/
cp -R prelude ./madlib-x86_64-pc-windows-mingw32/
cp ./tools/package-installer/dist/package-installer.js ./madlib-x86_64-pc-windows-mingw32/
tar -czvf madlib-x86_64-pc-windows-mingw32.tar.gz madlib-x86_64-pc-windows-mingw32
- uses: pdamianik/release-tag-to-upload-url-action@v1.0.1
id: release_upload_url
with:
tag: ${{ github.event.inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_upload_url.outputs.uploadUrl }}
asset_path: ./madlib-x86_64-pc-windows-mingw32.tar.gz
asset_name: madlib-x86_64-pc-windows-mingw32.tar.gz
asset_content_type: application/tar+gzip