Skip to content

Commit df3e997

Browse files
Setup NuGet package sources for Windows
1 parent 415da25 commit df3e997

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.github/workflows/cmake.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ jobs:
3131
if: ${{matrix.os == 'windows-latest'}}
3232
run: ${{github.workspace}}/vcpkg/bootstrap-vcpkg.bat
3333

34-
- name: Add NuGet sources
34+
- name: Add NuGet sources Linux
3535
if: ${{matrix.os == 'ubuntu-latest'}}
3636
shell: bash
3737
env:
3838
VCPKG_EXE: ${{github.workspace}}/vcpkg/vcpkg
39-
USERNAME: ${{github.repository_owner}}
4039
FEED_URL: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json
4140
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/${{github.repository_owner}}/index.json,readwrite"
4241
run: |
@@ -45,24 +44,42 @@ jobs:
4544
-Source "${{env.FEED_URL}}" \
4645
-StorePasswordInClearText \
4746
-Name GitHubPackages \
48-
-UserName "${{env.USERNAME}}" \
47+
-UserName "${{github.repository_owner}}" \
4948
-Password "${{secrets.GH_PACKAGES_TOKEN}}"
5049
mono `${{env.VCPKG_EXE}} fetch nuget | tail -n 1` \
5150
setapikey "${{secrets.GH_PACKAGES_TOKEN}}" \
5251
-Source "${{env.FEED_URL}}"
5352
53+
- name: Add NuGet sources Windows
54+
if: ${{matrix.os != 'ubuntu-latest'}}
55+
shell: bash
56+
env:
57+
VCPKG_EXE: ${{github.workspace}}/vcpkg/vcpkg
58+
FEED_URL: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json
59+
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/${{github.repository_owner}}/index.json,readwrite"
60+
run: |
61+
`${{env.VCPKG_EXE}} fetch nuget | tail -n 1` \
62+
sources add \
63+
-Source "${{env.FEED_URL}}" \
64+
-StorePasswordInClearText \
65+
-Name GitHubPackages \
66+
-UserName "${{github.repository_owner}}" \
67+
-Password "${{secrets.GH_PACKAGES_TOKEN}}"
68+
`${{env.VCPKG_EXE}} fetch nuget | tail -n 1` \
69+
setapikey "${{secrets.GH_PACKAGES_TOKEN}}" \
70+
-Source "${{env.FEED_URL}}"
71+
5472
- name: CMake version
5573
run: cmake --version
5674

5775
- name: CMake Linux workflow
5876
if: ${{matrix.os == 'ubuntu-latest'}}
5977
env:
60-
VCPKG_EXE: ${{github.workspace}}/vcpkg/vcpkg
61-
USERNAME: ${{github.repository_owner}}
62-
FEED_URL: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json
6378
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/${{github.repository_owner}}/index.json,readwrite"
6479
run: cmake --workflow --preset ci-linux
6580

6681
- name: CMake workflow
6782
if: ${{matrix.os != 'ubuntu-latest'}}
83+
env:
84+
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/${{github.repository_owner}}/index.json,readwrite"
6885
run: cmake --workflow --preset default

0 commit comments

Comments
 (0)