Skip to content

Commit 23330c7

Browse files
authored
fix: trying to use latest vcpkg
1 parent 3172e80 commit 23330c7

File tree

1 file changed

+96
-7
lines changed

1 file changed

+96
-7
lines changed

.github/workflows/build_windows.yml

Lines changed: 96 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ env:
44
RUSTFLAGS: -Ctarget-feature=+crt-static
55
VCPKG_DEFAULT_TRIPLET: x64-windows-static
66
VCPKG_DEFAULT_BINARY_CACHE: C:\vcpkg\.cache
7-
VCPKG_COMMIT: fba75d09065fcc76a25dcf386b1d00d33f5175af
7+
# VCPKG_COMMIT removed - will use latest
88

99
on:
1010
workflow_dispatch:
@@ -30,34 +30,76 @@ jobs:
3030
steps:
3131
- name: Check out repository
3232
uses: actions/checkout@v4
33+
3334
- name: Setup MSBuild.exe
3435
uses: microsoft/setup-msbuild@v2.0.0
3536
with:
3637
msbuild-architecture: x64
38+
3739
- name: Install gpac
3840
run: choco install gpac --version 2.4.0
41+
3942
- name: Setup vcpkg
4043
run: mkdir C:\vcpkg\.cache
44+
45+
- name: Get vcpkg commit hash
46+
id: vcpkg-commit
47+
run: |
48+
$commit = (git ls-remote https://github.com/microsoft/vcpkg HEAD | Select-Object -First 1).Split()[0]
49+
echo "hash=$commit" >> $env:GITHUB_OUTPUT
50+
echo "Using vcpkg commit: $commit"
51+
4152
- name: Cache vcpkg
4253
id: cache
4354
uses: actions/cache@v4
4455
with:
4556
path: |
4657
C:\vcpkg\.cache
47-
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }}
58+
key: vcpkg-${{ runner.os }}-${{ steps.vcpkg-commit.outputs.hash }}
59+
4860
- name: Build vcpkg
4961
run: |
5062
git clone https://github.com/microsoft/vcpkg
63+
cd vcpkg
64+
git pull origin master
65+
cd ..
5166
./vcpkg/bootstrap-vcpkg.bat
52-
- name: Install dependencies
53-
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/
67+
68+
- name: Install dependencies with retry
69+
run: |
70+
$maxRetries = 3
71+
$retryCount = 0
72+
$success = $false
73+
74+
while (-not $success -and $retryCount -lt $maxRetries) {
75+
try {
76+
Write-Host "Attempt $($retryCount + 1) of $maxRetries"
77+
& "${{ github.workspace }}/vcpkg/vcpkg.exe" install --x-install-root "${{ github.workspace }}/vcpkg/installed/"
78+
$success = $true
79+
Write-Host "Dependencies installed successfully"
80+
}
81+
catch {
82+
$retryCount++
83+
if ($retryCount -lt $maxRetries) {
84+
Write-Host "Installation failed. Retrying in 10 seconds..."
85+
Start-Sleep -Seconds 10
86+
}
87+
else {
88+
Write-Host "Installation failed after $maxRetries attempts"
89+
exit 1
90+
}
91+
}
92+
}
5493
working-directory: windows
94+
5595
- uses: actions-rs/toolchain@v1
5696
with:
5797
toolchain: stable
5898
override: true
99+
59100
- name: Install Win 10 SDK
60101
uses: ilammy/msvc-dev-cmd@v1
102+
61103
- name: build Release-Full
62104
env:
63105
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib"
@@ -67,48 +109,93 @@ jobs:
67109
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
68110
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64
69111
working-directory: ./windows
112+
70113
- name: Display version information
71114
run: ./ccextractorwinfull.exe --version
72115
working-directory: ./windows/x64/Release-Full
116+
73117
- uses: actions/upload-artifact@v4
74118
with:
75119
name: CCExtractor Windows Release build
76120
path: |
77121
./windows/x64/Release-Full/ccextractorwinfull.exe
78122
./windows/x64/Release-Full/*.dll
123+
79124
build_debug:
80125
runs-on: windows-2022
81126
steps:
82127
- name: Check out repository
83128
uses: actions/checkout@v4
129+
84130
- name: Setup MSBuild.exe
85131
uses: microsoft/setup-msbuild@v2.0.0
86132
with:
87133
msbuild-architecture: x64
134+
88135
- name: Install gpac
89136
run: choco install gpac --version 2.4.0
137+
90138
- name: Setup vcpkg
91139
run: mkdir C:\vcpkg\.cache
140+
141+
- name: Get vcpkg commit hash
142+
id: vcpkg-commit
143+
run: |
144+
$commit = (git ls-remote https://github.com/microsoft/vcpkg HEAD | Select-Object -First 1).Split()[0]
145+
echo "hash=$commit" >> $env:GITHUB_OUTPUT
146+
echo "Using vcpkg commit: $commit"
147+
92148
- name: Cache vcpkg
93149
id: cache
94150
uses: actions/cache@v4
95151
with:
96152
path: |
97153
C:\vcpkg\.cache
98-
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }}
154+
key: vcpkg-${{ runner.os }}-${{ steps.vcpkg-commit.outputs.hash }}
155+
99156
- name: Build vcpkg
100157
run: |
101158
git clone https://github.com/microsoft/vcpkg
159+
cd vcpkg
160+
git pull origin master
161+
cd ..
102162
./vcpkg/bootstrap-vcpkg.bat
103-
- name: Install dependencies
104-
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/
163+
164+
- name: Install dependencies with retry
165+
run: |
166+
$maxRetries = 3
167+
$retryCount = 0
168+
$success = $false
169+
170+
while (-not $success -and $retryCount -lt $maxRetries) {
171+
try {
172+
Write-Host "Attempt $($retryCount + 1) of $maxRetries"
173+
& "${{ github.workspace }}/vcpkg/vcpkg.exe" install --x-install-root "${{ github.workspace }}/vcpkg/installed/"
174+
$success = $true
175+
Write-Host "Dependencies installed successfully"
176+
}
177+
catch {
178+
$retryCount++
179+
if ($retryCount -lt $maxRetries) {
180+
Write-Host "Installation failed. Retrying in 10 seconds..."
181+
Start-Sleep -Seconds 10
182+
}
183+
else {
184+
Write-Host "Installation failed after $maxRetries attempts"
185+
exit 1
186+
}
187+
}
188+
}
105189
working-directory: windows
190+
106191
- uses: actions-rs/toolchain@v1
107192
with:
108193
toolchain: stable
109194
override: true
195+
110196
- name: Install Win 10 SDK
111197
uses: ilammy/msvc-dev-cmd@v1
198+
112199
- name: build Debug-Full
113200
env:
114201
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib"
@@ -118,10 +205,12 @@ jobs:
118205
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
119206
run: msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=x64
120207
working-directory: ./windows
208+
121209
- name: Display version information
122210
continue-on-error: true
123211
run: ./ccextractorwinfull.exe --version
124212
working-directory: ./windows/x64/Debug-Full
213+
125214
- uses: actions/upload-artifact@v4
126215
with:
127216
name: CCExtractor Windows Debug build

0 commit comments

Comments
 (0)