Skip to content

Commit f105f00

Browse files
committed
Revert "ci: always run setup-dotnet, run it earlier, and let it handle caching"
This reverts commit fdea79d.
1 parent fdea79d commit f105f00

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,12 @@ jobs:
4646
runs-on: ${{matrix.os}}
4747
steps:
4848
- uses: actions/checkout@v4
49-
50-
- name: Check .NET versions available
51-
shell: bash
52-
run: |
53-
echo "DOTNET_VERSION_LIST<<EOF" >> $GITHUB_ENV
54-
dotnet --list-sdks >> $GITHUB_ENV
55-
echo "EOF" >> $GITHUB_ENV
56-
dotnet --list-sdks
57-
58-
- name: Setup .NET 6,8
59-
uses: actions/setup-dotnet@v4
49+
- uses: actions/cache@v4
50+
id: cache
6051
with:
61-
cache: ${{ matrix.cache_dependencies }}
62-
dotnet-version: |
63-
6.x
64-
8.x
52+
path: ~/.nuget/packages
53+
key: ${{ runner.os }}-nuget-breaker3-${{ hashFiles('**/packages.lock.json') }}
54+
if: matrix.cache_dependencies
6555

6656
- uses: nowsprinting/check-version-format-action@v4
6757
id: version
@@ -94,7 +84,20 @@ jobs:
9484
echo Set HOST_ZIP_FILE to ${{ env.HOST_ZIP_FILE }}
9585
shell: bash
9686

97-
87+
- name: Check .NET versions available to see if we can skip install
88+
shell: bash
89+
run: |
90+
echo "DOTNET_VERSION_LIST<<EOF" >> $GITHUB_ENV
91+
dotnet --list-sdks >> $GITHUB_ENV
92+
echo "EOF" >> $GITHUB_ENV
93+
dotnet --list-sdks
94+
95+
- name: Setup .NET 6,8
96+
uses: actions/setup-dotnet@v4
97+
if: contains(env.DOTNET_VERSION_LIST, '8.0.') == 'false' || contains(env.DOTNET_VERSION_LIST, '6.0.') == 'false'
98+
with:
99+
dotnet-version: "6\n8\n"
100+
98101
- name: Clear & clean on release or cache miss
99102
run: |
100103
dotnet clean --configuration Release

0 commit comments

Comments
 (0)