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,41 +34,52 @@ 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
66- uses : actions/upload-artifact@v6
82+ uses : actions/upload-artifact@v7
6783 with :
6884 name : ${{ matrix.target }}
6985 path : |
@@ -88,20 +104,22 @@ 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
102120 zip -q -r libdigidocpp.${{ matrix.target }}.zip libdigidocpp.${{ matrix.target }}
103121 - name : Archive artifacts
104- uses : actions/upload-artifact@v6
122+ uses : actions/upload-artifact@v7
105123 with :
106124 name : ${{ matrix.target }}
107125 path : |
@@ -126,7 +144,7 @@ jobs:
126144 cmake --build build
127145 cmake --build build --target package
128146 - name : Archive artifacts
129- uses : actions/upload-artifact@v6
147+ uses : actions/upload-artifact@v7
130148 with :
131149 name : fedora_${{ matrix.container }}
132150 path : build/libdigidocpp*.rpm
@@ -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
@@ -169,16 +190,32 @@ jobs:
169190 - name : Lintian
170191 run : lintian *.deb;
171192 - name : Archive artifacts
172- uses : actions/upload-artifact@v6
193+ uses : actions/upload-artifact@v7
173194 with :
174195 name : ${{ matrix.dist }}_${{ matrix.ver }}_${{ matrix.arch }}
175196 path : libdigidocpp*.*
197+ python :
198+ name : Setup Python for Windows
199+ runs-on : windows-2025-vs2026
200+ steps :
201+ - name : Install Python
202+ run : |
203+ winget install --silent --accept-source-agreements --accept-package-agreements 9NQ7512CXL7T
204+ & "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\x86 3.13-32
205+ & "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\x64 3.13-64
206+ & "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\arm64 3.13-arm64
207+ - name : Upload Python
208+ uses : actions/upload-artifact@v7
209+ with :
210+ name : python
211+ path : python/
176212 windows :
177213 name : Build on Windows
178- runs-on : windows-2025
214+ needs : python
215+ runs-on : ${{ matrix.toolset == '143' && 'windows-2022' || 'windows-2025-vs2026' }}
179216 strategy :
180217 matrix :
181- toolset : [143]
218+ toolset : [143, 145 ]
182219 platform : [x86, x64, arm64]
183220 include :
184221 - platform : x86
@@ -200,9 +237,25 @@ jobs:
200237 uses : actions/cache@v5
201238 with :
202239 path : ${{ github.workspace }}/vcpkg_cache
203- key : vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }}
240+ key : vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
241+ - name : Setup winget
242+ if : matrix.toolset == '143'
243+ shell : powershell
244+ run : |
245+ Invoke-WebRequest -Uri https://raw.githubusercontent.com/asheroto/winget-install/refs/tags/5.3.6/winget-install.ps1 -OutFile winget-install.ps1
246+ .\winget-install.ps1 -Force
247+ $winget = (Get-Command winget -ErrorAction SilentlyContinue).Source
248+ if (-not $winget) {
249+ $winget = Get-Item "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*\winget.exe" | Select-Object -Last 1
250+ }
251+ Add-Content $env:GITHUB_PATH (Split-Path $winget)
204252 - name : Install dependencies
205- run : winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen 9NQ7512CXL7T
253+ run : winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen
254+ - name : Download Python
255+ uses : actions/download-artifact@v8
256+ with :
257+ name : python
258+ path : python/
206259 - uses : actions/setup-java@v5
207260 with :
208261 distribution : ' temurin'
@@ -211,16 +264,16 @@ jobs:
211264 env :
212265 VCPKG_BINARY_SOURCES : clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
213266 run : |
214- & "$env:LOCALAPPDATA\Microsoft\WindowsApps\py.exe" install --target=.\python\${{ matrix.platform }} 3.13-${{ matrix.python }}
215267 $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" `
268+ $vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
269+ & "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 `
270+ -vcpkg "C:/vcpkg" `
218271 -swig $swig `
219272 -doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
220273 -boost `
221274 -python ${{ github.workspace }}/python
222275 - name : Archive artifacts
223- uses : actions/upload-artifact@v6
276+ uses : actions/upload-artifact@v7
224277 with :
225278 name : msi_${{ matrix.toolset }}_${{ matrix.platform }}
226279 path : ./*.msi
0 commit comments