-
-
Notifications
You must be signed in to change notification settings - Fork 71
168 lines (161 loc) · 5.32 KB
/
build_windows.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
name: build_windows
on:
pull_request:
push:
env:
BRANCH: ${{ github.base_ref || github.ref_name }}
jobs:
build_lld:
strategy:
fail-fast: false
matrix:
arch: [x86, x64]
name: Build LLD ${{ matrix.arch }}
runs-on: windows-2019
timeout-minutes: 120
env:
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
# NB: update windows/build_lld.sha256sums as well
LLVM_VER: 9.0.0
ARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- shell: cmd
run: call windows\build_lld.bat || exit /b
- uses: actions/upload-artifact@v3
with:
name: lld-${{ matrix.arch }}
path: artifacts/
build_mingw_libs:
name: Build MinGW-based libs
runs-on: windows-2019
timeout-minutes: 120
env:
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
# NB: update windows/build_mingw.sha256sums as well
MINGW_VER: 8.0.0
D_VERSION: 2.077.1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- shell: cmd
run: call windows\build_mingw.bat || exit /b
- uses: actions/upload-artifact@v3
with:
name: mingw-libs
path: artifacts/
build_curl:
name: Build curl
runs-on: windows-2019
timeout-minutes: 120
env:
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
# NB: update windows/build_curl.sha256sums as well
CURL_VER: 7.68.0
ZLIB_VER: 1.2.11
PEXPORTS_VER: 0.47
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- shell: cmd
run: call windows\build_curl.bat || exit /b
- uses: actions/upload-artifact@v3
with:
name: curl
path: artifacts/
build_docs:
name: Build docs
runs-on: ubuntu-20.04
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Clone repos
run: |
set -eux
git clone --branch $BRANCH https://github.com/dlang/dlang.org.git work/dlang.org
git clone --branch $BRANCH https://github.com/dlang/dmd.git work/dmd
git clone --branch $BRANCH https://github.com/dlang/phobos.git work/phobos
- name: Build docs
run: make -C work/dlang.org -f posix.mak release
- name: Zip
run: |
set -eux
mkdir -p work/docs
zip -r work/docs/docs.zip work/dlang.org/web
- uses: actions/upload-artifact@v3
with:
name: docs
path: work/docs
build_release:
name: Build release
runs-on: windows-2019
timeout-minutes: 120
needs: build_docs
env:
LDC_VSDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
HOST_LDC_VERSION: 1.23.0
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs
path: docs/
- name: Install prerequisites
shell: bash
run: |
set -eux
powershell -command "& { iwr https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-windows-multilib.7z -OutFile ldc.7z }"
7z x ldc.7z
mv ldc2-$HOST_LDC_VERSION-windows-multilib ldc2
powershell -command "& { iwr https://downloads.dlang.org/other/dm857c.zip -OutFile dmc.zip }"
7z x dmc.zip
powershell -command "& { iwr http://ftp.digitalmars.com/sppn.zip -OutFile sppn.zip }"
7z x -odm/bin sppn.zip
powershell -command "& { iwr http://ftp.digitalmars.com/bup.zip -OutFile bup.zip }"
7z x bup.zip dm/bin/implib.exe
powershell -command "& { iwr https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip -OutFile inetc.zip }"
7z x inetc.zip -y -bb1 '-oc:\Program Files (x86)\NSIS'
- name: Unzip docs
shell: bash
run: |
set -eux
unzip docs/docs.zip
mv work/dlang.org/web create_dmd_release/docs
- name: Build release
shell: bash
run: |
set -eux
powershell -command "& { iwr https://dlang.org/d-keyring.gpg -OutFile d-keyring.gpg }"
gpg --import d-keyring.gpg
export PATH="$PWD/dm/bin:$PATH"
cd create_dmd_release
../ldc2/bin/ldmd2 -g build_all.d common.d -version=NoVagrant
cp ../ldc2/bin/libcurl.dll .
./build_all v$HOST_LDC_VERSION $BRANCH
- name: Unzip build
shell: bash
run: 7z x create_dmd_release/build/dmd.$BRANCH.windows.zip -odmd.$BRANCH.windows
- name: Build installer
shell: cmd
run: |
@echo on
"c:\Program Files (x86)\NSIS\makensis" /version
for /f %%v in (dmd.%BRANCH%.windows\dmd2\src\version) do set ver=%%v
cd windows || exit /b
"c:\Program Files (x86)\NSIS\makensis" /DVersion2=%ver% /DEmbedD2Dir=..\dmd.%BRANCH%.windows\dmd2 d2-installer.nsi || exit /b
cd .. || exit /b
mkdir artifacts || exit /b
copy windows\*.exe artifacts || exit /b
- uses: actions/upload-artifact@v3
with:
name: win_release
path: artifacts/