-
-
Notifications
You must be signed in to change notification settings - Fork 47
216 lines (189 loc) · 6.69 KB
/
release.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: "Create a release"
on:
push:
tags:
- '*'
env:
BUILD_TYPE: Release
SQLITE_VERSION: 3390100 # 3.39.1
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {
os: ubuntu-24.04, name: "Ubuntu Clang 16",
compiler: clang, compiler_version: 16,
artifact: "ubuntu-clang-16"
}
- {
os: ubuntu-24.04, name: "Ubuntu GCC 14",
compiler: gcc, compiler_version: 14,
artifact: "ubuntu-gcc-14"
}
- {
os: windows-latest, name: "Windows VS 2022",
compiler: msvc, compiler_version: "",
artifact: "windows-msvc-22"
}
- {
os: macos-latest, name: "MacOS Clang 16",
artifact: "macos-clang-16",
compiler: clang, compiler_version: 16,
}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup compilers, dependencies, project and build
uses: ./.github/workflows/setup-compilers
with:
os_name: ${{ matrix.config.os }}
compiler: ${{ matrix.config.compiler }}
compiler_version: ${{ matrix.config.compiler_version }}
sanitizers: 'Off'
with_deps: true
- name: Organize files for upload
if: startsWith(matrix.config.name, 'Ubuntu') || startsWith(matrix.config.name, 'MacOS')
shell: bash
run: |
mkdir -p artifact/lib/std
cp build/arkscript artifact
cp build/libArkReactor.* artifact
cp lib/*.arkm artifact/lib
cp lib/std/*.ark artifact/lib/std
rm -rf artifact/lib/std/{.git,.github,tests/__arkscript__}
- name: Organize files for upload
if: startsWith(matrix.config.name, 'Windows')
shell: bash
run: |
mkdir -p artifact/lib/std
cp build/$BUILD_TYPE/arkscript.exe artifact
cp build/$BUILD_TYPE/ArkReactor.dll artifact
cp lib/*.arkm artifact/lib
cp lib/std/*.ark artifact/lib/std
rm -rf artifact/lib/std/{.git,.github,tests/__arkscript__}
- name: Generate InnoSetup installer
if: startsWith(matrix.config.name, 'Windows')
uses: SuperFola/is-build-action@master
with:
path-to-script: 'Installer.iss'
artifact-name: 'arkscript.exe'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact }}
path: artifact
retention-days: 1
release:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Download artifact Linux GCC 14
uses: actions/download-artifact@v4
with:
name: ubuntu-gcc-14
path: ark-ubuntu-gcc-14
- name: Download artifact Linux Clang 16
uses: actions/download-artifact@v4
with:
name: ubuntu-clang-16
path: ark-ubuntu-clang-16
- name: Download artifact Windows MSVC 19
uses: actions/download-artifact@v4
with:
name: windows-msvc-22
path: ark-windows-msvc-22
- name: Download artifact MacOS Clang
uses: actions/download-artifact@v4
with:
name: macos-clang-16
path: ark-macos-clang-16
- name: Download artifact Windows InnoSetup installer
uses: actions/download-artifact@v4
with:
name: arkscript.exe
path: ark-windows-installer
- name: Make ZIPs
shell: bash
run: |
for i in ark-*; do
name=`echo $i | cut -c 5-`
(cd ${i} && zip -r ../${name}.zip ./)
done
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Create release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ArkScript ${{ env.RELEASE_VERSION }}
draft: true
prerelease: false
body: ${{ steps.extract-release-notes.outputs.release_notes }}
- uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "A new release (${{ env.RELEASE_VERSION }}) has been drafted"
description: |
Please review it **before publishing it**, as this action would trigger workflows and GitHub webhooks,
notifying everyone of a new release! You want to be sure **everything** is correct
[Release draft URL](${{ steps.create_release.outputs.html_url }})
nodetail: true
username: GitHub Actions
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ubuntu-gcc-14.zip
asset_name: linux-gcc-14.zip
asset_content_type: application/zip
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ubuntu-clang-16.zip
asset_name: linux-clang-16.zip
asset_content_type: application/zip
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-msvc-22.zip
asset_name: windows-msvc-22.zip
asset_content_type: application/zip
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ark-windows-installer/arkscript.exe
asset_name: windows-installer.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./macos-clang-16.zip
asset_name: macos-clang-16.zip
asset_content_type: application/zip