1414 runs-on : macos-latest
1515 strategy :
1616 matrix :
17- target : [macos, iphoneos, iphonesimulator]
17+ include :
18+ - target : macos
19+ - target : iphoneos
20+ triplet : arm64-ios
21+ - target : iphonesimulator
22+ triplet : arm64-x64-ios-simulator
1823 steps :
1924 - name : Checkout
2025 uses : actions/checkout@v6
@@ -29,39 +34,50 @@ jobs:
2934 sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.13
3035 sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.14
3136 - name : Cache
37+ if : matrix.target == 'macos'
3238 uses : actions/cache@v5
3339 id : cache
3440 with :
3541 path : cache
3642 key : ${{ matrix.target }}-${{ hashFiles('prepare_osx_build_environment.sh') }}
43+ - name : Cache vcpkg
44+ if : matrix.target != 'macos'
45+ uses : actions/cache@v5
46+ with :
47+ path : ${{ github.workspace }}/vcpkg_cache
48+ key : vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json') }}
3749 - name : Build openssl
38- if : steps.cache.outputs.cache-hit != 'true'
50+ if : matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
3951 run : ./prepare_osx_build_environment.sh openssl ${{ matrix.target }}
4052 - name : Build xmlsec
41- if : steps.cache.outputs.cache-hit != 'true'
53+ if : matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4254 run : ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
4355 - name : Move to cache
44- if : steps.cache.outputs.cache-hit != 'true'
56+ if : matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4557 run : |
4658 mkdir cache
4759 sudo mv /Library/libdigidocpp* cache
48- - name : Setup cache
49- run : sudo ln -s $PWD/cache/* /Library/
5060 - name : Build macOS
5161 if : matrix.target == 'macos'
5262 run : |
63+ sudo ln -s $PWD/cache/* /Library/
5364 cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
5465 cmake --build --preset ${{ matrix.target }}
55- cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
66+ cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
5667 cmake --build --preset ${{ matrix.target }} --target zipdebug pkgbuild
5768 - name : Build ${{ matrix.target }}
5869 if : matrix.target != 'macos'
70+ env :
71+ VCPKG_BINARY_SOURCES : clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
5972 run : |
73+ export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
6074 cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
6175 cmake --build --preset ${{ matrix.target }}
62- sudo cmake --build --preset ${{ matrix.target }} --target install/strip
63- cd /Library
64- zip -q -r ${OLDPWD}/libdigidocpp.${{ matrix.target }}.zip libdigidocpp.*
76+ cmake --build --preset ${{ matrix.target }} --target install/strip
77+ mkdir -p libdigidocpp.${{ matrix.target }}/include
78+ cp build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/lib/{libcrypto,libssl}.a libdigidocpp.${{ matrix.target }}/lib/
79+ cp -r build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/include/openssl libdigidocpp.${{ matrix.target }}/include/
80+ zip -q -r libdigidocpp.${{ matrix.target }}.zip libdigidocpp.${{ matrix.target }}
6581 - name : Archive artifacts
6682 uses : actions/upload-artifact@v6
6783 with :
@@ -88,14 +104,16 @@ jobs:
88104 uses : actions/cache@v5
89105 with :
90106 path : ${{ github.workspace }}/vcpkg_cache
91- key : vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**' ) }}
107+ key : vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json') }}
92108 - name : Build
93109 env :
94110 VCPKG_BINARY_SOURCES : clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
95111 run : |
96112 export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
97113 export ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME
98114 export ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME
115+ git -C $VCPKG_INSTALLATION_ROOT fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
116+ git -C $VCPKG_INSTALLATION_ROOT reset --hard f77737496dabd44c63ecc599dc0f4d6cff30d0d5
99117 cmake --preset ${{ matrix.target }} "-GUnix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo
100118 cmake --build --preset ${{ matrix.target }}
101119 cmake --build --preset ${{ matrix.target }} --target install/strip
@@ -151,6 +169,9 @@ jobs:
151169 steps :
152170 - name : Install dependencies
153171 run : |
172+ for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
173+ [ -f "$f" ] && sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g; s|http://security.ubuntu.com|http://azure.archive.ubuntu.com|g' "$f"
174+ done
154175 echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/99-nodocs
155176 echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
156177 echo 'path-exclude=/usr/share/doc-base/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
@@ -175,10 +196,10 @@ jobs:
175196 path : libdigidocpp*.*
176197 windows :
177198 name : Build on Windows
178- runs-on : windows-2025
199+ runs-on : windows-2025${{ matrix.toolset == '145' && '-vs2026' || '' }}
179200 strategy :
180201 matrix :
181- toolset : [143]
202+ toolset : [143, 145 ]
182203 platform : [x86, x64, arm64]
183204 include :
184205 - platform : x86
@@ -200,7 +221,7 @@ jobs:
200221 uses : actions/cache@v5
201222 with :
202223 path : ${{ github.workspace }}/vcpkg_cache
203- key : vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**' ) }}
224+ key : vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
204225 - name : Install dependencies
205226 run : winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
206227 - uses : actions/setup-java@v5
@@ -213,8 +234,9 @@ jobs:
213234 run : |
214235 & "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.13-${{ matrix.python }}
215236 $swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target
216- & "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
217- -vcpkg "C:/vcpkg/vcpkg.exe" `
237+ $vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
238+ & "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
239+ -vcpkg "C:/vcpkg" `
218240 -swig $swig `
219241 -doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
220242 -boost `
0 commit comments