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,56 @@ 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') }}
49+ - name : Fetch vcpkg baseline
50+ if : matrix.target != 'macos'
51+ run : |
52+ export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
53+ cd $VCPKG_ROOT
54+ git fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
3755 - name : Build openssl
38- if : steps.cache.outputs.cache-hit != 'true'
56+ if : matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
3957 run : ./prepare_osx_build_environment.sh openssl ${{ matrix.target }}
4058 - name : Build xmlsec
41- if : steps.cache.outputs.cache-hit != 'true'
59+ if : matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4260 run : ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }}
4361 - name : Move to cache
44- if : steps.cache.outputs.cache-hit != 'true'
62+ if : matrix.target == 'macos' && steps.cache.outputs.cache-hit != 'true'
4563 run : |
4664 mkdir cache
4765 sudo mv /Library/libdigidocpp* cache
48- - name : Setup cache
49- run : sudo ln -s $PWD/cache/* /Library/
5066 - name : Build macOS
5167 if : matrix.target == 'macos'
5268 run : |
69+ sudo ln -s $PWD/cache/* /Library/
5370 cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
5471 cmake --build --preset ${{ matrix.target }}
55- cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
72+ cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs
5673 cmake --build --preset ${{ matrix.target }} --target zipdebug pkgbuild
5774 - name : Build ${{ matrix.target }}
5875 if : matrix.target != 'macos'
76+ env :
77+ VCPKG_BINARY_SOURCES : clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
5978 run : |
79+ export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
6080 cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo
6181 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.*
82+ cmake --build --preset ${{ matrix.target }} --target install/strip
83+ mkdir -p libdigidocpp.${{ matrix.target }}/include
84+ cp build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/lib/{libcrypto,libssl}.a libdigidocpp.${{ matrix.target }}/lib/
85+ cp -r build/${{ matrix.target }}/vcpkg_installed/${{ matrix.triplet }}/include/openssl libdigidocpp.${{ matrix.target }}/include/
86+ zip -q -r libdigidocpp.${{ matrix.target }}.zip libdigidocpp.${{ matrix.target }}
6587 - name : Archive artifacts
6688 uses : actions/upload-artifact@v6
6789 with :
@@ -88,7 +110,12 @@ jobs:
88110 uses : actions/cache@v5
89111 with :
90112 path : ${{ github.workspace }}/vcpkg_cache
91- key : vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
113+ key : vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json') }}
114+ - name : Fetch vcpkg baseline
115+ run : |
116+ export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
117+ cd $VCPKG_ROOT
118+ git fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
92119 - name : Build
93120 env :
94121 VCPKG_BINARY_SOURCES : clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
@@ -151,6 +178,9 @@ jobs:
151178 steps :
152179 - name : Install dependencies
153180 run : |
181+ for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
182+ [ -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"
183+ done
154184 echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/99-nodocs
155185 echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
156186 echo 'path-exclude=/usr/share/doc-base/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs
@@ -175,10 +205,10 @@ jobs:
175205 path : libdigidocpp*.*
176206 windows :
177207 name : Build on Windows
178- runs-on : windows-2025
208+ runs-on : windows-2025${{ matrix.toolset == '145' && '-vs2026' || '' }}
179209 strategy :
180210 matrix :
181- toolset : [143]
211+ toolset : [143, 145 ]
182212 platform : [x86, x64, arm64]
183213 include :
184214 - platform : x86
@@ -200,7 +230,11 @@ jobs:
200230 uses : actions/cache@v5
201231 with :
202232 path : ${{ github.workspace }}/vcpkg_cache
203- key : vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
233+ key : vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
234+ - name : Fetch vcpkg baseline
235+ run : |
236+ cd C:\vcpkg
237+ git fetch origin f77737496dabd44c63ecc599dc0f4d6cff30d0d5
204238 - name : Install dependencies
205239 run : winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
206240 - uses : actions/setup-java@v5
@@ -213,7 +247,8 @@ jobs:
213247 run : |
214248 & "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.13-${{ matrix.python }}
215249 $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 `
250+ $vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
251+ & "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
217252 -vcpkg "C:/vcpkg/vcpkg.exe" `
218253 -swig $swig `
219254 -doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
0 commit comments