-
Notifications
You must be signed in to change notification settings - Fork 11
179 lines (179 loc) · 6.45 KB
/
releases-mingw-new.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
name: Build Artifacts (MinGW)
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
pull_request:
branches: [master, develop]
paths-ignore:
- '**/*.md'
- '.circleci/**'
- '.cirrus.yml'
push:
branches: [master, develop]
paths-ignore:
- '**/*.md'
- '.circleci/**'
- '.cirrus.yml'
release:
types: [published]
schedule:
- cron: '0 16 * * *'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
env:
CACHE_EPOCH: 131-1
GOPROXY: direct
jobs:
mingw64-release:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- arch: i686
variant: msvcrt
- arch: x86_64
variant: ucrt
- arch: aarch64
variant: ucrt
env:
BUILD_TYPE: 'Release'
steps:
- uses: actions/checkout@v4
- name: Checkout with shallow submodules
run: |
# unshallow must come first otherwise submodule may be get unshallowed
git fetch --tags --unshallow
git submodule update --init --depth 1
- name: Cache toolchain
id: toolchain-cache
uses: actions/cache@v4
with:
path: |
third_party/llvm-build/Release+Asserts
key: ${{ runner.os }}-toolchain-${{ hashFiles('CLANG_REVISION') }}-v${{ env.CACHE_EPOCH }}
- name: Cache mingw64 llvm sysroot
id: sysroot-cache
uses: actions/cache@v4
with:
path: |
third_party/llvm-mingw-20240619-${{ matrix.variant }}-ubuntu-20.04-x86_64
key: ${{ runner.os }}-mingw64-sysroot-third_party-llvm-20240619-${{ matrix.variant }}-v1
- name: Cache mingw64 curl
id: curl-cache
uses: actions/cache@v4
with:
path: |
third_party/curl-8.4.0_7-win64a-mingw
third_party/curl-8.4.0_7-win64-mingw
third_party/curl-8.4.0_7-win32-mingw
key: ${{ runner.os }}-mingw64-curl-and-aarch64-v1
- uses: actions/setup-go@v5
with:
go-version: '>=1.20.0'
cache-dependency-path: |
tools/go.sum
third_party/boringssl/src/go.sum
- name: Build build tool
run: |
cd tools
go build
- name: Change ubuntu mirror
run: |
sudo sed -i 's/azure.archive.ubuntu.com/azure.archive.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update -qq
- name: "Install dependency: prebuilt clang and clang-tidy binaries"
if: ${{ steps.toolchain-cache.outputs.cache-hit != 'true' }}
run: |
./scripts/download-clang-prebuilt-binaries.py
rm -f third_party/llvm-build/Release+Asserts/*.tgz
- name: "Download dependency: llvm-mingw sysroot"
if: ${{ steps.sysroot-cache.outputs.cache-hit != 'true' }}
run: |
pushd third_party
curl -L -O https://github.com/mstorsjo/llvm-mingw/releases/download/20240619/llvm-mingw-20240619-${{ matrix.variant }}-ubuntu-20.04-x86_64.tar.xz
tar -xf llvm-mingw-20240619-${{ matrix.variant }}-ubuntu-20.04-x86_64.tar.xz
rm -vf llvm-mingw-*.xz
popd
- name: "Download dependency: curl"
if: ${{ steps.curl-cache.outputs.cache-hit != 'true' }}
run: |
./scripts/download-curl-mingw.sh i686
./scripts/download-curl-mingw.sh x86_64
./scripts/download-curl-mingw.sh aarch64
- name: Populate depedencies
run: |
sudo apt-get update -qq
sudo apt-get install -y cmake ninja-build nasm zip nsis locales-all
- name: Populate dependencie (cmake, overwrite)
run: |
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.29.8/cmake-3.29.8-linux-x86_64.tar.gz
sudo tar -C /usr/local --strip-components=1 -xf cmake-3.29.8-linux-x86_64.tar.gz
cmake --version
rm -f *.tar.gz
- name: Populate depedencies (i686)
if: ${{ matrix.arch == 'i686' }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -qq
sudo apt-get install -y wine wine32
- name: Populate depedencies (x86_64)
if: ${{ matrix.arch == 'x86_64' }}
run: |
sudo apt-get update -qq
sudo apt-get install -y wine wine64
- name: Patch libcxx for windows xp
if: ${{ matrix.arch == 'i686' || matrix.arch == 'x86_64' }}
run: |
pushd third_party/libc++/trunk
patch -p1 < ../winxp.patch
popd
pushd third_party/libc++abi/trunk
patch -p1 < ../winxp.patch
popd
echo "BUILD_OPTIONS=-mingw-allow-xp -enable-lto=false" >> $GITHUB_ENV
- name: Build
run: |
# fix cpack error on C.UTF-8 locale
# see https://github.com/lightspark/lightspark/discussions/604#discussioncomment-1034262
export LC_ALL=en_US.UTF-8
./tools/build --variant gui --arch ${{ matrix.arch }} --system mingw \
-build-test -build-benchmark \
-mingw-dir $PWD/third_party/llvm-mingw-20240619-${{ matrix.variant }}-ubuntu-20.04-x86_64 \
${{ env.BUILD_OPTIONS }}
- name: Populate depedencies (Tests-i686)
if: ${{ matrix.arch == 'i686' }}
run: |
# copy curl dll required by yass_test
cp -v third_party/curl-8.4.0_7-win32-mingw/bin/libcurl.dll build-mingw-winxp-${{ matrix.arch }}/
- name: Populate depedencies (Tests-x86_64)
if: ${{ matrix.arch == 'x86_64' }}
run: |
# copy curl dll required by yass_test
cp -v third_party/curl-8.4.0_7-win64-mingw/bin/libcurl-x64.dll build-mingw-winxp-${{ matrix.arch }}/
- name: Run tests
if: ${{ matrix.arch == 'i686' || matrix.arch == 'x86_64' }}
run: |
cd build-mingw-winxp-${{ matrix.arch }}
wine yass_test.exe
wine yass_benchmark.exe
- name: Upload dist tarball
if: ${{ github.event_name == 'release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} *.zip *.exe