-
Notifications
You must be signed in to change notification settings - Fork 119
268 lines (232 loc) · 9.88 KB
/
release.yml
File metadata and controls
268 lines (232 loc) · 9.88 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: Release
# Run on pre-release, full release, or manual trigger
on:
workflow_dispatch:
release:
types: [prereleased, published]
defaults:
run:
shell: bash
jobs:
###########################################################
pre_job:
###########################################################
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest-fat
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content'
do_not_skip: '["pull_request", "workflow_dispatch", "release"]'
###########################################################
build:
###########################################################
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ${{ matrix.runner }}
env:
das_dll_build: ${{ github.event_name == 'release' && 'YES' || 'NO' }}
strategy:
fail-fast: false
matrix:
target: [linux, linux_arm, darwin15, darwin26, windows]
architecture: [32, 64, arm64]
cmake_preset: [ Release ]
include:
- target: linux
release_target: linux
release_arch: x86_64
runner: ubuntu-latest-fat
archive_ext: tar.gz
- target: linux_arm
release_target: linux
release_arch: arm64
runner: ubuntu-24.04-arm-fat
archive_ext: tar.gz
- target: darwin26
release_target: darwin26
release_arch: arm64
runner: macos-26-xlarge # Apple Silicon arm64
architecture_string: arm64
archive_ext: tar.gz
- target: darwin15
release_target: darwin15
release_arch: x86_64
runner: macos-15-large # Intel x86_64
architecture_string: x86_64
archive_ext: tar.gz
- target: windows
runner: windows-latest-fat
archive_ext: zip
- target: windows
build_system: cmake
cmake_generator: Visual Studio 17 2022
- target: darwin15
build_system: cmake
cmake_generator: Ninja
- target: darwin26
build_system: cmake
cmake_generator: Ninja
- target: linux
build_system: cmake
cmake_generator: Ninja
- target: linux_arm
build_system: cmake
cmake_generator: Ninja
- target: windows
release_target: windows
release_arch: x86_64
architecture: 64
architecture_string: x64
exclude:
- target: darwin15
architecture: 32
- target: darwin15
architecture: arm64
- target: darwin26
architecture: 32
- target: darwin26
architecture: 64
- target: linux
architecture: 32
- target: linux
architecture: arm64
- target: linux_arm
architecture: 32
# The linux_arm × 64 cell already produces daslang-bundle-linux-arm64.zip
# (release_arch: arm64 via the include overlay at L53-57, which applies
# to all linux_arm cells regardless of architecture). Lifting this
# exclude would make the ×arm64 cell build the same bundle name on the
# same ARM64 hardware (ubuntu-24.04-arm-fat) and clobber via the
# `--clobber` flag in the upload step. Wasted CI for no extra artifact.
- target: linux_arm
architecture: arm64
- target: windows
architecture: arm64
- target: windows
architecture: 32
steps:
- name: "SCM Checkout"
uses: actions/checkout@v4
- name: "Install CMake and Ninja"
uses: lukka/get-cmake@latest
- if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1 # need nasm for openssl
- name: "Install: Required Dev Packages"
run: |
set -eux
case "${{ matrix.target }}${{ matrix.architecture }}" in
linux64|linux_arm*)
echo "MARCH=64" >> $GITHUB_ENV
sudo apt-get update -y
sudo apt-get install --no-install-recommends -y \
libatomic-ops-dev \
libglu1-mesa-dev \
freeglut3-dev \
mesa-common-dev \
libglfw3-dev \
libfreetype6-dev \
libudev-dev \
libopenal-dev \
libvorbis-dev \
libflac-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxinerama-dev \
libxi-dev
;;
darwin15arm64|darwin26arm64)
brew install bison openssl
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/bison/lib -L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
;;
darwin1564|darwin2664)
arch -x86_64 brew install bison openssl
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/opt/homebrew/opt/bison/lib -L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
;;
esac
- name: "Install openssl windows"
if: runner.os == 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg && ./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install openssl:${{ matrix.architecture == 32 && 'x86' || 'x64' }}-windows --binarycaching
echo "VCPKG_ROOT=$(pwd)/vcpkg" >> $GITHUB_ENV
echo "CMAKE_TOOLCHAIN_FILE=$(pwd)/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
- name: "Build: Daslang Linux with modules"
if: runner.os != 'Windows'
run: |
set -eux
mkdir build
ACTIVE_MODULES=$(cat ci/release_modules.txt | grep -v "^#" | cut -d':' -f2 | sed 's|^|-D|' | xargs)
case "${{ matrix.build_system }}" in
cmake)
case "${{ matrix.target }}${{ matrix.architecture }}" in
linux64)
# Match build.yml: use clang. The default ubuntu-24.04 g++ (GCC 13.3)
# rejects AOT-generated patterns like `struct User { TTuple<…,Profile> Profile; }`
# with -Wchanges-meaning, even though daslib/aot_cpp.das now emits
# elaborated `struct Profile` to avoid that — keeping clang consistent
# across CI eliminates the divergence.
CC=clang CXX=clang++ cmake --no-warn-unused-cli -B./build -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_preset }} \
-G "${{ matrix.cmake_generator }}" $ACTIVE_MODULES
cmake --build ./build --config ${{ matrix.cmake_preset }} --parallel
;;
*)
export CXXFLAGS="-Wno-elaborated-enum-base" # glfw module fails due to mac-os includes
CC=clang CXX=clang++ cmake --no-warn-unused-cli -B./build -DCMAKE_OSX_ARCHITECTURES="${{ matrix.architecture_string }}" \
-DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_preset }} -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-G "${{ matrix.cmake_generator }}" $ACTIVE_MODULES
cmake --build ./build --config ${{ matrix.cmake_preset }} --parallel
;;
esac
;;
esac
- name: "Build: Daslang Windows with modules"
if: runner.os == 'Windows'
run: |
set -eux
mkdir build
export PATH="/c/Strawberry/perl/bin:$PATH" # prepend Strawberry perl to path, so openssl will use it.
ACTIVE_MODULES=$(cat ci/release_modules.txt | grep -v "^#" | cut -d':' -f2 | sed 's|^|-D|' | xargs)
case "${{ matrix.build_system }}" in
cmake)
cmake --no-warn-unused-cli -B./build -G "${{ matrix.cmake_generator }}" -T host=${{ matrix.architecture == 32 && 'x86' || 'x64' }} -A ${{ matrix.architecture_string }} \
$ACTIVE_MODULES -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build ./build --config ${{ matrix.cmake_preset }} --parallel
;;
esac
- name: "Run tests"
if: matrix.architecture_string != 'Win32'
run: |
if [[ "${{ matrix.target }}" == windows* ]]; then
cd "bin/${{ matrix.cmake_preset }}"
TEST_PATH="../../tests"
EXEC=".exe"
else
cd bin
TEST_PATH="../tests"
EXEC=""
fi
./daslang${EXEC} _dasroot_/dastest/dastest.das -jit -- --color --failures-only --test "$TEST_PATH"
- name: "Install binaries"
if: matrix.cmake_preset == 'Release'
shell: bash
run: |
mkdir daslang_bundle
mkdir artifacts
cmake --install ./build --prefix ./daslang_bundle --config ${{ matrix.cmake_preset }} --strip
7z a artifacts/daslang-bundle-${{ matrix.release_target }}-${{ matrix.release_arch }}.zip ./daslang_bundle
- name: "Upload release asset"
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased') && matrix.cmake_preset == 'Release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ github.event.release.tag_name }}" artifacts/daslang-bundle-${{ matrix.release_target }}-${{ matrix.release_arch }}.zip --clobber