Skip to content

Commit c14d204

Browse files
committed
Build dependencies with vcpkg for Linux
1 parent 4f27c08 commit c14d204

File tree

1 file changed

+102
-11
lines changed

1 file changed

+102
-11
lines changed

.github/workflows/build.yaml

Lines changed: 102 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
VCPKG_REVISION: 137197a8f85e6c6cf1843ef024af7d9c28bb0bde
1111

1212
jobs:
13-
static:
13+
static-windows:
1414
strategy:
1515
fail-fast: true
1616
matrix:
@@ -97,7 +97,7 @@ jobs:
9797
name: vcpkg-x64-${{ matrix.image }}-static-${{ github.sha }}
9898
path: ${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-static-${{ github.sha }}.7z
9999

100-
dynamic:
100+
dynamic-windows:
101101
strategy:
102102
fail-fast: true
103103
matrix:
@@ -200,9 +200,87 @@ jobs:
200200
working-directory: ${{ github.workspace }}/SymStore
201201
run: aws --endpoint-url https://rgw.ctrl-c.liu.se s3 sync --size-only --exclude * --include *.dl_ --include *.pd_ . s3://openmw-sym
202202

203+
dynamic-linux:
204+
strategy:
205+
fail-fast: true
206+
207+
runs-on: ubuntu-24.04
208+
209+
name: dynamic-linux
210+
211+
steps:
212+
- uses: actions/checkout@v4
213+
214+
- run: sudo apt update
215+
216+
- run: >
217+
sudo apt install -y
218+
autoconf-archive
219+
libegl1-mesa-dev
220+
libgl-dev
221+
libibus-1.0-dev
222+
libltdl-dev
223+
libwayland-dev
224+
libx11-dev
225+
libxext-dev
226+
libxft-dev
227+
libxkbcommon-dev
228+
nasm
229+
230+
- name: Export GitHub Actions cache environment variables
231+
uses: actions/github-script@v6
232+
with:
233+
script: |
234+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
235+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
236+
237+
- uses: actions/checkout@v4
238+
with:
239+
repository: microsoft/vcpkg
240+
ref: ${{ env.VCPKG_REVISION }}
241+
path: vcpkg
242+
243+
- working-directory: vcpkg
244+
run: git checkout ${{ env.VCPKG_REVISION }}
245+
246+
- working-directory: vcpkg
247+
run: ./bootstrap-vcpkg.sh -disableMetrics
248+
249+
- name: Install vcpkg packages
250+
run: >
251+
vcpkg install --overlay-ports=ports --triplet x64-linux
252+
boost-geometry
253+
boost-iostreams
254+
boost-program-options
255+
bullet3[double-precision,multithreading]
256+
ffmpeg
257+
freetype
258+
icu
259+
luajit
260+
lz4
261+
mygui
262+
openal-soft
263+
openmw-osg
264+
sdl2
265+
266+
- name: Export installed vcpkg packages
267+
run: >
268+
vcpkg export
269+
--x-all-installed
270+
--7zip
271+
--output-dir ${{ github.workspace }}
272+
--output vcpkg-x64-linux-${{ github.sha }}
273+
274+
- name: Store exported vcpkg packages
275+
uses: actions/upload-artifact@v4
276+
with:
277+
name: vcpkg-x64-linux-${{ github.sha }}
278+
path: ${{ github.workspace }}/vcpkg-x64-linux-${{ github.sha }}.7z
279+
203280
push-dynamic:
204281
needs:
205-
- dynamic
282+
- dynamic-windows
283+
- dynamic-linux
206284

207285
runs-on: ubuntu-latest
208286

@@ -231,12 +309,15 @@ jobs:
231309
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-${{ github.sha }}.7z vcpkg-x64-windows-2022-${{ env.file }}.7z
232310
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2019-pdb-${{ github.sha }}.7z vcpkg-x64-windows-2019-pdb-${{ env.file }}.7z
233311
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-pdb-${{ github.sha }}.7z vcpkg-x64-windows-2022-pdb-${{ env.file }}.7z
312+
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-linux-${{ github.sha }}.7z vcpkg-x64-linux-${{ env.file }}.7z
234313
235314
- name: Release
236315
if: startsWith(github.ref, 'refs/tags/')
237316
uses: softprops/action-gh-release@v2
238317
with:
239-
files: vcpkg-x64-windows-*-${{ env.file }}.7z
318+
files: |
319+
vcpkg-x64-windows-*-${{ env.file }}.7z
320+
vcpkg-x64-linux-${{ env.file }}.7z
240321
241322
- name: Setup ssh-agent
242323
env:
@@ -292,14 +373,23 @@ jobs:
292373
if: ${{ env.SSH_PRIVATE_KEY == '' }}
293374
run: git clone https://gitlab.com/OpenMW/openmw-deps.git
294375

295-
- name: Generate files containing a download url and hash
376+
- name: Generate files containing a download url and hash for windows
296377
run: |
297-
for file in vcpkg-x64-windows-*-${{ env.file }}.7z; do
298-
filename=`echo "$file" | sed -r 's/vcpkg-x64-windows-(.+)-${{ env.file }}.7z/vcpkg-x64-\1-${{ env.file }}.txt/'`
299-
echo "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ env.file }}/$file" > "openmw-deps/windows/$filename"
300-
shasum -a 512 "$file" >> "openmw-deps/windows/$filename"
378+
mkdir -p openmw-deps/windows
379+
for src in vcpkg-x64-windows-*-${{ env.file }}.7z; do
380+
dst=$(echo "${src:?}" | sed -r 's/vcpkg-x64-windows-(.+)-${{ env.file }}.7z/vcpkg-x64-\1-${{ env.file }}.txt/')
381+
echo "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ env.file }}/${src:?}" > "openmw-deps/windows/${dst:?}"
382+
shasum -a 512 "${src:?}" >> "openmw-deps/windows/${dst:?}"
301383
done
302384
385+
- name: Generate files containing a download url and hash for linux
386+
run: |
387+
mkdir -p openmw-deps/linux
388+
src=vcpkg-x64-linux-${{ env.file }}.7z
389+
dst=vcpkg-x64-linux-${{ env.file }}.txt
390+
echo "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ env.file }}/${src}" > "openmw-deps/linux/${dst:?}"
391+
shasum -a 512 "${src:?}" >> "openmw-deps/linux/${dst:?}"
392+
303393
- name: Generate commit message
304394
env:
305395
GH_TOKEN: ${{ github.token }}
@@ -315,8 +405,9 @@ jobs:
315405
- name: Commit generated metadata
316406
working-directory: ${{ github.workspace }}/openmw-deps
317407
run: |
318-
git checkout -b vcpkg-x64-windows-${{ github.sha }}
408+
git checkout -b vcpkg-x64-${{ github.sha }}
319409
git add windows/vcpkg-x64-*-${{ env.file }}.txt
410+
git add linux/vcpkg-x64-*-${{ env.file }}.txt
320411
git commit -F commit_message.txt
321412
322413
- name: Verify commit to openmw-deps repository
@@ -332,4 +423,4 @@ jobs:
332423
working-directory: ${{ github.workspace }}/openmw-deps
333424
run: |
334425
git remote set-url --push origin "${{ vars.PUSH_URL }}"
335-
git push origin vcpkg-x64-windows-${{ github.sha }}
426+
git push origin vcpkg-x64-${{ github.sha }}

0 commit comments

Comments
 (0)