Skip to content

Commit c544aab

Browse files
DadoumAdam-le-dev
authored andcommitted
Use the latest version of LDC in automated macOS builds.
1 parent bbf63d1 commit c544aab

File tree

4 files changed

+50
-40
lines changed

4 files changed

+50
-40
lines changed

.github/workflows/build-cli.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ jobs:
146146
- name: Set-up macOS cross-compilation
147147
run: |
148148
mkdir -p $HOME/.ldc/
149+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
149150
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
150151
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
151152
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -163,17 +164,17 @@ jobs:
163164
];
164165
// default switches appended after all explicit command-line switches
165166
post-switches = [
166-
"-I$HOME/ldc2-1.33.0-osx-x86_64/import",
167+
"-I$HOME/ldc2-$LDC_VERSION-osx-x86_64/import",
167168
];
168169
// default directories to be searched for libraries when linking
169170
lib-dirs = [
170-
"$HOME/ldc2-1.33.0-osx-x86_64/lib",
171+
"$HOME/ldc2-$LDC_VERSION-osx-x86_64/lib",
171172
];
172173
};
173174
EOF
174175
mkdir $HOME/ldc-macos
175-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-x86_64.tar.xz
176-
tar -xf ./ldc2-1.33.0-osx-x86_64.tar.xz -C $HOME
176+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-x86_64.tar.xz
177+
tar -xf ./ldc2-$LDC_VERSION-osx-x86_64.tar.xz -C $HOME
177178
178179
- name: Install dependencies
179180
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld
@@ -208,6 +209,7 @@ jobs:
208209
- name: Set-up macOS cross-compilation
209210
run: |
210211
mkdir -p $HOME/.ldc/
212+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
211213
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
212214
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
213215
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -225,17 +227,17 @@ jobs:
225227
];
226228
// default switches appended after all explicit command-line switches
227229
post-switches = [
228-
"-I$HOME/ldc2-1.33.0-osx-arm64/import",
230+
"-I$HOME/ldc2-$LDC_VERSION-osx-arm64/import",
229231
];
230232
// default directories to be searched for libraries when linking
231233
lib-dirs = [
232-
"$HOME/ldc2-1.33.0-osx-arm64/lib",
234+
"$HOME/ldc2-$LDC_VERSION-osx-arm64/lib",
233235
];
234236
};
235237
EOF
236238
mkdir $HOME/ldc-macos
237-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz
238-
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME
239+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-arm64.tar.xz
240+
tar -xf ./ldc2-$LDC_VERSION-osx-arm64.tar.xz -C $HOME
239241
240242
- name: Install dependencies
241243
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld

.github/workflows/build-dlangui.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ jobs:
148148
- name: Set-up macOS cross-compilation
149149
run: |
150150
mkdir -p $HOME/.ldc/
151+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
151152
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
152153
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
153154
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -165,17 +166,17 @@ jobs:
165166
];
166167
// default switches appended after all explicit command-line switches
167168
post-switches = [
168-
"-I$HOME/ldc2-1.33.0-osx-x86_64/import",
169+
"-I$HOME/ldc2-$LDC_VERSION-osx-x86_64/import",
169170
];
170171
// default directories to be searched for libraries when linking
171172
lib-dirs = [
172-
"$HOME/ldc2-1.33.0-osx-x86_64/lib",
173+
"$HOME/ldc2-$LDC_VERSION-osx-x86_64/lib",
173174
];
174175
};
175176
EOF
176177
mkdir $HOME/ldc-macos
177-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-x86_64.tar.xz
178-
tar -xf ./ldc2-1.33.0-osx-x86_64.tar.xz -C $HOME
178+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-x86_64.tar.xz
179+
tar -xf ./ldc2-$LDC_VERSION-osx-x86_64.tar.xz -C $HOME
179180
180181
- name: Install dependencies
181182
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld
@@ -210,6 +211,7 @@ jobs:
210211
- name: Set-up macOS cross-compilation
211212
run: |
212213
mkdir -p $HOME/.ldc/
214+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
213215
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
214216
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
215217
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -227,17 +229,17 @@ jobs:
227229
];
228230
// default switches appended after all explicit command-line switches
229231
post-switches = [
230-
"-I$HOME/ldc2-1.33.0-osx-arm64/import",
232+
"-I$HOME/ldc2-$LDC_VERSION-osx-arm64/import",
231233
];
232234
// default directories to be searched for libraries when linking
233235
lib-dirs = [
234-
"$HOME/ldc2-1.33.0-osx-arm64/lib",
236+
"$HOME/ldc2-$LDC_VERSION-osx-arm64/lib",
235237
];
236238
};
237239
EOF
238240
mkdir $HOME/ldc-macos
239-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz
240-
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME
241+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-arm64.tar.xz
242+
tar -xf ./ldc2-$LDC_VERSION-osx-arm64.tar.xz -C $HOME
241243
242244
- name: Install dependencies
243245
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld

.github/workflows/build-gtk.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ jobs:
147147
- name: Set-up macOS cross-compilation
148148
run: |
149149
mkdir -p $HOME/.ldc/
150+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
150151
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
151152
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
152153
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -164,17 +165,17 @@ jobs:
164165
];
165166
// default switches appended after all explicit command-line switches
166167
post-switches = [
167-
"-I$HOME/ldc2-1.33.0-osx-x86_64/import",
168+
"-I$HOME/ldc2-$LDC_VERSION-osx-x86_64/import",
168169
];
169170
// default directories to be searched for libraries when linking
170171
lib-dirs = [
171-
"$HOME/ldc2-1.33.0-osx-x86_64/lib",
172+
"$HOME/ldc2-$LDC_VERSION-osx-x86_64/lib",
172173
];
173174
};
174175
EOF
175176
mkdir $HOME/ldc-macos
176-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-x86_64.tar.xz
177-
tar -xf ./ldc2-1.33.0-osx-x86_64.tar.xz -C $HOME
177+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-x86_64.tar.xz
178+
tar -xf ./ldc2-$LDC_VERSION-osx-x86_64.tar.xz -C $HOME
178179
179180
- name: Install dependencies
180181
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld
@@ -210,6 +211,7 @@ jobs:
210211
- name: Set-up macOS cross-compilation
211212
run: |
212213
mkdir -p $HOME/.ldc/
214+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
213215
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
214216
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
215217
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -227,17 +229,17 @@ jobs:
227229
];
228230
// default switches appended after all explicit command-line switches
229231
post-switches = [
230-
"-I$HOME/ldc2-1.33.0-osx-arm64/import",
232+
"-I$HOME/ldc2-$LDC_VERSION-osx-arm64/import",
231233
];
232234
// default directories to be searched for libraries when linking
233235
lib-dirs = [
234-
"$HOME/ldc2-1.33.0-osx-arm64/lib",
236+
"$HOME/ldc2-$LDC_VERSION-osx-arm64/lib",
235237
];
236238
};
237239
EOF
238240
mkdir $HOME/ldc-macos
239-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz
240-
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME
241+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-arm64.tar.xz
242+
tar -xf ./ldc2-$LDC_VERSION-osx-arm64.tar.xz -C $HOME
241243
242244
- name: Install dependencies
243245
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld

.github/workflows/build-qt.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ jobs:
6565

6666
- uses: dlang-community/setup-dlang@v1
6767
with:
68-
compiler: ldc-1.33.0
68+
compiler: ldc-latest
6969

7070
- name: Set-up macOS cross-compilation
7171
run: |
7272
mkdir -p $HOME/.ldc/
73+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
7374
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
7475
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
7576
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -84,7 +85,7 @@ jobs:
8485
"-Xcc=-isysroot",
8586
"-Xcc=$HOME/MacOSX11.0.sdk",
8687
"-Xcc=-F",
87-
"-Xcc=$HOME/ldc2-1.33.0-osx-x86_64/lib",
88+
"-Xcc=$HOME/ldc2-$LDC_VERSION-osx-x86_64/lib",
8889
"-Xcc=-mmacosx-version-min=12.6",
8990
"-L=-platform_version",
9091
"-L=macos",
@@ -94,25 +95,26 @@ jobs:
9495
];
9596
// default switches appended after all explicit command-line switches
9697
post-switches = [
97-
"-I$HOME/ldc2-1.33.0-osx-x86_64/import",
98+
"-I$HOME/ldc2-$LDC_VERSION-osx-x86_64/import",
9899
];
99100
// default directories to be searched for libraries when linking
100101
lib-dirs = [
101-
"$HOME/ldc2-1.33.0-osx-x86_64/lib",
102+
"$HOME/ldc2-$LDC_VERSION-osx-x86_64/lib",
102103
];
103104
};
104105
EOF
105106
mkdir $HOME/ldc-macos
106-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-x86_64.tar.xz
107-
tar -xf ./ldc2-1.33.0-osx-x86_64.tar.xz -C $HOME
107+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-x86_64.tar.xz
108+
tar -xf ./ldc2-$LDC_VERSION-osx-x86_64.tar.xz -C $HOME
108109
brew fetch --force --bottle-tag=monterey llvm@16
109110
brew install $(brew --cache --bottle-tag=monterey llvm@16)
110-
cp /home/linuxbrew/.linuxbrew/Cellar/llvm@16/16.0.6/lib/c++/* $HOME/ldc2-1.33.0-osx-x86_64/lib
111+
cp /home/linuxbrew/.linuxbrew/Cellar/llvm@16/16.0.6/lib/c++/* $HOME/ldc2-$LDC_VERSION-osx-x86_64/lib
111112
rm -rf /home/linuxbrew/.linuxbrew
112113
113114
- name: Set-up Qt for cross-compilation
114115
run:
115-
cp -r $Qt5_DIR/lib/* $HOME/ldc2-1.33.0-osx-x86_64/lib
116+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
117+
cp -r $Qt5_DIR/lib/* $HOME/ldc2-$LDC_VERSION-osx-x86_64/lib
116118

117119
- name: Install dependencies
118120
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld-15
@@ -151,7 +153,7 @@ jobs:
151153

152154
- uses: dlang-community/setup-dlang@v1
153155
with:
154-
compiler: ldc-1.33.0
156+
compiler: ldc-latest
155157

156158
- name: Set up Homebrew
157159
id: set-up-homebrew
@@ -170,6 +172,7 @@ jobs:
170172
- name: Set-up macOS cross-compilation
171173
run: |
172174
mkdir -p $HOME/.ldc/
175+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
173176
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
174177
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME
175178
cat << EOF | tee $HOME/.ldc/ldc2.conf
@@ -184,7 +187,7 @@ jobs:
184187
"-Xcc=-isysroot",
185188
"-Xcc=$HOME/MacOSX11.0.sdk",
186189
"-Xcc=-F",
187-
"-Xcc=$HOME/ldc2-1.33.0-osx-arm64/lib",
190+
"-Xcc=$HOME/ldc2-$LDC_VERSION-osx-arm64/lib",
188191
"-Xcc=-mmacosx-version-min=12.6",
189192
"-L=-platform_version",
190193
"-L=macos",
@@ -194,25 +197,26 @@ jobs:
194197
];
195198
// default switches appended after all explicit command-line switches
196199
post-switches = [
197-
"-I$HOME/ldc2-1.33.0-osx-arm64/import",
200+
"-I$HOME/ldc2-$LDC_VERSION-osx-arm64/import",
198201
];
199202
// default directories to be searched for libraries when linking
200203
lib-dirs = [
201-
"$HOME/ldc2-1.33.0-osx-arm64/lib",
204+
"$HOME/ldc2-$LDC_VERSION-osx-arm64/lib",
202205
];
203206
};
204207
EOF
205208
mkdir $HOME/ldc-macos
206-
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz
207-
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME
209+
curl -LO https://github.com/ldc-developers/ldc/releases/download/v$LDC_VERSION/ldc2-$LDC_VERSION-osx-arm64.tar.xz
210+
tar -xf ./ldc2-$LDC_VERSION-osx-arm64.tar.xz -C $HOME
208211
brew fetch --force --bottle-tag=arm64_monterey llvm@16
209212
brew install $(brew --cache --bottle-tag=arm64_monterey llvm@16)
210-
cp /home/linuxbrew/.linuxbrew/Cellar/llvm@16/16.0.6/lib/c++/* $HOME/ldc2-1.33.0-osx-arm64/lib
213+
cp /home/linuxbrew/.linuxbrew/Cellar/llvm@16/16.0.6/lib/c++/* $HOME/ldc2-$LDC_VERSION-osx-arm64/lib
211214
rm -rf /home/linuxbrew/.linuxbrew
212215
213216
- name: Set-up Qt for cross-compilation
214217
run:
215-
cp -r $Qt5_DIR/lib/* $HOME/ldc2-1.33.0-osx-arm64/lib
218+
LDC_VERSION=$(ldc2 --version | head -n 1 | grep -oE "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
219+
cp -r $Qt5_DIR/lib/* $HOME/ldc2-$LDC_VERSION-osx-arm64/lib
216220

217221
- name: Install dependencies
218222
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld-15

0 commit comments

Comments
 (0)