-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
199 lines (177 loc) · 6.7 KB
/
action.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: 'Arturo Builder'
description: 'Setup Arturo environment'
branding:
icon: terminal
color: purple
inputs:
mode:
description: >-
The Arturo version to install
(one of: 'mini', 'full', 'safe', 'web')
default: 'full'
token:
description: >-
The GITHUB_TOKEN secret.
required: true
arch:
description: >-
The architecture to build for.
(one of: 'x86', 'arm', 'arm64', 'amd64', 'native')
default: 'native'
src:
description: >-
Which Arturo version to use.
default: ''
metadata:
description: >-
Embeddable build metadata
default: ''
runs:
using: "composite"
steps:
- name: Checkout Arturo repo
uses: actions/checkout@v4
with:
repository: arturo-lang/arturo
submodules: recursive
path: arturo
ref: ${{ inputs.src }}
- name: Debugging
run: |
echo ${{ runner.os }}
echo ${{ runner.arch }}
ls -la
ls -la arturo
shell: bash
- name: Set build metadata
if: inputs.metadata != ''
run: |
echo "${{ inputs.metadata }}" > arturo/version/metadata
shell: bash
- name: Cache ChooseNim
if: runner.os == 'Linux' || runner.os == 'macOS'
id: cache-choosenim
uses: actions/cache@v4
with:
path: ~/.choosenim
key: ${{ runner.os }}-choosenim-${{ steps.get-date.outputs.date }}
- name: Cache Nimble
if: runner.os == 'Linux' || runner.os == 'macOS'
id: cache-nimble
uses: actions/cache@v4
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
- name: Setup Msys
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
update: true
cache: true
install: 'git base-devel p7zip mingw-w64-x86_64-toolchain'
- name: Install Nim (Linux)
if: runner.os == 'Linux'
uses: jiro4989/setup-nim-action@v1
with:
nim-version: '2.2.0'
repo-token: ${{ inputs.token }}
- name: Install Nim (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install nim
shell: bash
- name: Install Nim (Windows / mini)
if: runner.os == 'Windows' && inputs.mode == 'mini'
run: |
mkdir dist
mkdir nim
curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip
curl -L https://nim-lang.org/download/nim-2.2.0_x64.zip -o dist/nim.zip
7z x dist/dlls.zip -obin
7z x dist/nim.zip -onim
export PATH="${{ github.workspace }}/nim/nim-2.2.0/bin":$PATH
cd arturo
./build.nims build --mode ${{ inputs.mode }} --log
cd ..
cp bin/*.dll /usr/bin
cp arturo/bin/arturo.exe /usr/bin
shell: msys2 {0}
- name: Install Nim (Windows / full)
if: runner.os == 'Windows' && inputs.mode == 'full'
run: |
pacman --noconfirm -S mingw-w64-x86_64-mpfr
mkdir dist
mkdir nim
curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip
curl -L https://arturo-lang.s3.amazonaws.com/extra-dlls.zip -o dist/extradlls.zip
curl -L https://nim-lang.org/download/nim-2.2.0_x64.zip -o dist/nim.zip
7z x dist/dlls.zip -obin
7z x dist/extradlls.zip -obin
7z x dist/nim.zip -onim
cp arturo/src/extras/webview/deps/dlls/x64/*.dll bin
export PATH="${{ github.workspace }}/nim/nim-2.2.0/bin":$PATH
cd arturo
./build.nims build --mode ${{ inputs.mode }} --log
cd ..
cp bin/*.dll /usr/bin
cp arturo/bin/arturo.exe /usr/bin
curl -L https://curl.se/ca/cacert.pem -o /usr/bin/cacert.pem
shell: msys2 {0}
- name: Install dependencies (Linux / mini / x86)
if: runner.os == 'Linux' && inputs.mode == 'mini' && inputs.arch == 'x86'
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib
shell: bash
- name: Install dependencies (Linux / mini / arm)
if: runner.os == 'Linux' && inputs.mode == 'mini' && (inputs.arch == 'arm' || inputs.arch == 'arm64')
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
shell: bash
- name: Install dependencies (Linux / full)
if: runner.os == 'Linux' && inputs.mode != 'mini'
run: |
npm install -g uglify-js
sudo apt-get update
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev libmpfr-dev
shell: bash
- name: Install dependencies (macOS / arm)
if: runner.os == 'macOS' && runner.arch == 'ARM64' && inputs.mode != 'mini'
run: |
brew install pcre
shell: bash
- name: Compile Arturo (Linux/macOS - native)
if: inputs.mode != 'web' && runner.os != 'Windows' && (inputs.arch == 'native' || inputs.arch == 'amd64') && runner.arch != 'ARM64'
run: |
cd arturo
./build.nims --install --mode ${{inputs.mode}} --arch amd64 --log
echo "$HOME/.arturo/bin" >> $GITHUB_PATH
cd ..
shell: bash
- name: Compile Arturo (macOS - M1)
if: inputs.mode != 'web' && (inputs.arch == 'native' || inputs.arch == 'arm64') && (runner.os == 'macOS' && runner.arch == 'ARM64')
run: |
cd arturo
./build.nims --install --mode ${{inputs.mode}} --arch arm64 --log
echo "$HOME/.arturo/bin" >> $GITHUB_PATH
cd ..
shell: bash
- name: Compile Arturo (Linux)
if: inputs.mode != 'web' && inputs.arch != 'native' && inputs.arch != 'amd64' && runner.os == 'Linux'
run: |
cd arturo
./build.nims --install --mode ${{inputs.mode}} --arch ${{inputs.arch}} --log
echo "$HOME/.arturo/bin" >> $GITHUB_PATH
cd ..
shell: bash
- name: Compile Arturo (Web)
if: inputs.mode == 'web'
run: |
cd arturo
./build.nims --mode ${{ inputs.mode }} --log
./build.nims --install --mode full --arch ${{ inputs.arch }} --log
echo "$HOME/.arturo/bin" >> $GITHUB_PATH
cd ..
shell: bash