Skip to content

Commit 9d4b950

Browse files
committed
Moved .NET SDK version to pipeline environment variable
1 parent b0fff4e commit 9d4b950

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/publish-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
env:
99
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
1010
DOTNET_NOLOGO: true
11+
DOTNET_SDK_VERSION: 9.0.307
1112

1213
jobs:
1314
publish:
@@ -32,7 +33,7 @@ jobs:
3233

3334
- name: Add version to global.json
3435
run: |
35-
$version = "9.0.307"
36+
$version = $Env:DOTNET_SDK_VERSION
3637
$globalJsonPath = "global.json"
3738
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
3839
if ($null -eq $globalJson.sdk.version) {
@@ -46,7 +47,7 @@ jobs:
4647
- name: Install .NET Core
4748
uses: actions/setup-dotnet@v5
4849
with:
49-
dotnet-version: 9.0.307
50+
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
5051

5152
- name: Add the GitHub source
5253
run: dotnet nuget add source --username USERNAME --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text --name "github.com" "https://nuget.pkg.github.com/fsprojects/index.json"

.github/workflows/publish-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ env:
99
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
1010
DOTNET_NOLOGO: true
1111
SLEEP_DURATION: 60
12+
DOTNET_SDK_VERSION: 9.0.307
1213

1314
jobs:
1415
publish:
@@ -34,7 +35,7 @@ jobs:
3435

3536
- name: Add version to global.json
3637
run: |
37-
$version = "9.0.307"
38+
$version = $Env:DOTNET_SDK_VERSION
3839
$globalJsonPath = "global.json"
3940
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
4041
if ($null -eq $globalJson.sdk.version) {
@@ -48,7 +49,7 @@ jobs:
4849
- name: Install .NET Core
4950
uses: actions/setup-dotnet@v5
5051
with:
51-
dotnet-version: 9.0.307
52+
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
5253

5354
- name: Install local tools
5455
run: dotnet tool restore

0 commit comments

Comments
 (0)