-
Notifications
You must be signed in to change notification settings - Fork 0
3d jan/vcpkg binary cache #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
12224a5
e83d1de
049dd6c
55c0b06
6ed2199
1f79b3f
6976ca9
a89f2c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,9 +12,15 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_call: # Allow this workflow to be called by other workflows | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| packages: write # Required for vcpkg binary caching with GitHub Packages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json,readwrite" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -89,6 +95,75 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: ./bootstrap-vcpkg.bat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ github.workspace }}/vcpkg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install mono for NuGet (Linux) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: runner.os != 'Windows' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: sudo apt-get install -y mono-complete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install buildcache (Linux) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: runner.os != 'Windows' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget https://github.com/mbitsnbites/buildcache/releases/download/v0.28.1/buildcache-linux.tar.gz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tar -xzf buildcache-linux.tar.gz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo cp buildcache/bin/buildcache /usr/local/bin/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildcache --version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install buildcache (Windows) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: runner.os == 'Windows' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Invoke-WebRequest -Uri "https://github.com/mbitsnbites/buildcache/releases/download/v0.28.1/buildcache-windows.zip" -OutFile "buildcache.zip" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expand-Archive -Path "buildcache.zip" -DestinationPath "buildcache" -Force | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copy-Item -Path "buildcache\buildcache\bin\buildcache.exe" -Destination "C:\Windows\System32\buildcache.exe" -Force | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildcache --version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache buildcache (Linux) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: runner.os != 'Windows' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: ~/.buildcache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: buildcache-${{ matrix.os }}-${{ matrix.c_compiler }}-${{ github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildcache-${{ matrix.os }}-${{ matrix.c_compiler }}- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+124
to
+126
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache buildcache (Windows) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: runner.os == 'Windows' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: ~\AppData\Local\buildcache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: buildcache-${{ matrix.os }}-${{ matrix.c_compiler }}-${{ github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buildcache-${{ matrix.os }}-${{ matrix.c_compiler }}- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+133
to
+135
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup NuGet authentication for vcpkg binary caching (Linux) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: runner.os != 'Windows' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mono `${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1` \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sources add \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -StorePasswordInClearText \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -Name GitHubPackages \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -UserName "${{ github.repository_owner }}" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -Password "${{ secrets.GITHUB_TOKEN }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mono `${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1` \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+141
to
+148
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mono `${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1` \ | |
| sources add \ | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{ github.repository_owner }}" \ | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| mono `${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1` \ | |
| mono $(${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1) \ | |
| sources add \ | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{ github.repository_owner }}" \ | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| mono $(${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1) \ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same command substitution syntax issue as above. Use $(...) instead of backticks. Change to: mono $(vcpkg/vcpkg fetch nuget | tail -n 1)
| mono `${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1` \ | |
| sources add \ | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{ github.repository_owner }}" \ | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| mono `${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1` \ | |
| mono $(${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1) \ | |
| sources add \ | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{ github.repository_owner }}" \ | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| mono $(${{ github.workspace }}/vcpkg/vcpkg fetch nuget | tail -n 1) \ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell syntax is incorrect. The $(...) should wrap the entire command execution, not be used to concatenate strings with GitHub Actions expressions. Change to: & \"$(vcpkg/vcpkg fetch nuget)\" or use proper string interpolation.
| & "$(${{ github.workspace }}/vcpkg/vcpkg fetch nuget)" ` | |
| sources add ` | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` | |
| -StorePasswordInClearText ` | |
| -Name GitHubPackages ` | |
| -UserName "${{ github.repository_owner }}" ` | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| & "$(${{ github.workspace }}/vcpkg/vcpkg fetch nuget)" ` | |
| & "$(${{ github.workspace }}\vcpkg\vcpkg fetch nuget)" ` | |
| sources add ` | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` | |
| -StorePasswordInClearText ` | |
| -Name GitHubPackages ` | |
| -UserName "${{ github.repository_owner }}" ` | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| & "$(${{ github.workspace }}\vcpkg\vcpkg fetch nuget)" ` |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same PowerShell syntax issue as above. The $(...) should wrap the entire command execution. Change to: & \"$(vcpkg/vcpkg fetch nuget)\" or use proper string interpolation.
| & "$(${{ github.workspace }}/vcpkg/vcpkg fetch nuget)" ` | |
| sources add ` | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` | |
| -StorePasswordInClearText ` | |
| -Name GitHubPackages ` | |
| -UserName "${{ github.repository_owner }}" ` | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| & "$(${{ github.workspace }}/vcpkg/vcpkg fetch nuget)" ` | |
| & "$(& '${{ github.workspace }}/vcpkg/vcpkg fetch nuget')" ` | |
| sources add ` | |
| -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` | |
| -StorePasswordInClearText ` | |
| -Name GitHubPackages ` | |
| -UserName "${{ github.repository_owner }}" ` | |
| -Password "${{ secrets.GITHUB_TOKEN }}" | |
| & "$(& '${{ github.workspace }}/vcpkg/vcpkg fetch nuget')" ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying to C:\Windows\System32\ requires elevated permissions and may fail in GitHub Actions runners. Consider using a location in the PATH that doesn't require admin rights, such as adding the buildcache directory to $env:PATH or using a user-accessible directory.