-
Notifications
You must be signed in to change notification settings - Fork 2
191 lines (159 loc) · 7.21 KB
/
buildnightlies.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
name: Build Nightlies
on:
push:
branches:
- 'master'
- 'actions'
tags-ignore:
- '**'
pull_request:
paths-ignore:
- 'docs/*'
- '*.yml'
- '*.md'
- 'LICENSE'
schedule:
- cron: '46 20 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- {name: "Linux (amd64 / full)", os: ubuntu-latest, arch: amd64, mode: full, shell: bash}
- {name: "Linux (amd64 / safe)", os: ubuntu-latest, arch: amd64, mode: safe, shell: bash}
- {name: "Linux (amd64 / mini)", os: ubuntu-latest, arch: amd64, mode: mini, shell: bash}
- {name: "Linux (arm64 / mini)", os: ubuntu-latest, arch: arm64, mode: mini, shell: bash}
- {name: "JS (web / mini)", os: ubuntu-latest, arch: amd64, mode: web, shell: bash}
- {name: "Windows (amd64 / full)", os: windows-latest, arch: amd64, mode: full, shell: "msys2 {0}"}
- {name: "Windows (amd64 / mini)", os: windows-latest, arch: amd64, mode: mini, shell: "msys2 {0}"}
- {name: "macOS (amd64 / full)", os: macos-13, arch: amd64, mode: full, shell: bash}
- {name: "macOS (amd64 / mini)", os: macos-13, arch: amd64, mode: mini, shell: bash}
- {name: "macOS (arm64 / full)", os: macos-latest, arch: arm64, mode: full, shell: bash}
- {name: "macOS (arm64 / mini)", os: macos-latest, arch: arm64, mode: mini, shell: bash}
name: ${{ matrix.name }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Get current date
run: echo $(date -u "+%F") >> currentDate
shell: bash
- name: "Read date"
uses: pCYSl5EDgo/cat@master
id: currentDate
with:
path: currentDate
trim: true
- name: Install Arturo
uses: arturo-lang/arturo-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
mode: ${{ matrix.mode }}
arch: ${{ matrix.arch }}
metadata: nightly.${{ steps.currentDate.outputs.text }}
- name: Prepare artifact
id: artifact-details
if: matrix.os != 'windows-latest'
run: |
binary_path="arturo/bin/arturo"
artifact_os="macos"
artifact_arch="${{matrix.arch}}"
artifact_mode="${{matrix.mode}}"
if [ "${{matrix.os}}" = "windows-latest" ]; then
artifact_os="windows"
binary_path="${binary_path}.exe"
fi
if [ "${{matrix.os}}" = "ubuntu-latest" ]; then
artifact_os="linux"
if [ "${{matrix.mode}}" = "web" ]; then
artifact_os="js"
artifact_arch="web"
artifact_mode="mini"
binary_path="${binary_path}.js"
fi
fi
cd arturo
git_stamp="nightly.${{ steps.currentDate.outputs.text }}"
cd ..
artifact_name="arturo-${git_stamp}-${artifact_arch}-${artifact_os}-${artifact_mode}"
echo "BINARY_PATH=$binary_path" >> "$GITHUB_OUTPUT"
echo "ARTIFACT_NAME=$artifact_name" >> "$GITHUB_OUTPUT"
- name: Prepare artifact (Windows)
id: artifact-details-win
if: matrix.os == 'windows-latest'
run: |
binary_path="arturo/bin"
artifact_os="windows"
artifact_arch="${{matrix.arch}}"
artifact_mode="${{matrix.mode}}"
cd arturo
git_stamp="nightly.${{ steps.currentDate.outputs.text }}"
rm bin/placeholder
if [ "${{matrix.mode}}" = "full" ]; then
cp src/extras/webview/deps/dlls/x64/webview.dll bin
cp src/extras/webview/deps/dlls/x64/WebView2Loader.dll bin
curl -L https://arturo-lang.s3.amazonaws.com/libgmp-10.dll -o libgmp-10.dll
curl -L https://arturo-lang.s3.amazonaws.com/libmpfr-6.dll -o libmpfr-6.dll
curl -L https://arturo-lang.s3.amazonaws.com/sqlite3_64.dll -o sqlite3_64.dll
curl -L https://arturo-lang.s3.amazonaws.com/libgcc_s_seh-1.dll -o libgcc_s_seh-1.dll
fi
curl -L https://arturo-lang.s3.amazonaws.com/libwinpthread-1.dll -o libwinpthread-1.dll
curl -L https://arturo-lang.s3.amazonaws.com/pcre64.dll -o pcre64.dll
curl -L https://curl.se/ca/cacert.pem -o cacert.pem
cp *.dll bin
cp *.pem bin
cd ..
artifact_name="arturo-${git_stamp}-${artifact_arch}-${artifact_os}-${artifact_mode}"
echo "BINARY_PATH=$binary_path" >> "$GITHUB_OUTPUT"
echo "ARTIFACT_NAME=$artifact_name" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: 'actions/upload-artifact@v4'
if: matrix.os != 'windows-latest'
with:
name: ${{ steps.artifact-details.outputs.ARTIFACT_NAME }}
path: ${{ steps.artifact-details.outputs.BINARY_PATH }}
- name: Upload artifact (Windows)
uses: 'actions/upload-artifact@v4'
if: matrix.os == 'windows-latest'
with:
name: ${{ steps.artifact-details-win.outputs.ARTIFACT_NAME }}
path: ${{ steps.artifact-details-win.outputs.BINARY_PATH }}
release:
name: "Release"
runs-on: ubuntu-latest
if: (github.event_name == 'schedule' ) || (github.event_name == 'workflow_dispatch')
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Get current date
run: echo $(date -u "+%F") >> currentDate
shell: bash
- name: "Read date"
uses: pCYSl5EDgo/cat@master
id: currentDate
with:
path: currentDate
trim: true
- name: Download existing artifacts
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_unpack: true
path: ./assets
- name: Debug environment
run: |
ls -laR ./assets
shell: bash
- name: Upload release assets
run: |
DESC=""
gh release create "${{ steps.currentDate.outputs.text }}" $DESC ./assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash