Skip to content

Commit 1737829

Browse files
committed
Set version to global.json
1 parent 96caa76 commit 1737829

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/publish_ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- dev
77

8+
env:
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
10+
DOTNET_NOLOGO: true
11+
812
jobs:
913
publish:
1014

@@ -25,6 +29,15 @@ jobs:
2529
echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
2630
shell: pwsh
2731

32+
- name: Add version to global.json
33+
run: |
34+
$version = "7.0.406"
35+
$globalJsonPath = "global.json"
36+
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
37+
$globalJson.sdk.version = $version
38+
$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath
39+
shell: pwsh
40+
2841
- name: Install .NET Core
2942
uses: actions/setup-dotnet@v4
3043
with:

.github/workflows/publish_release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- 'releases/*'
77

8+
env:
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
10+
DOTNET_NOLOGO: true
11+
812
jobs:
913
publish:
1014
runs-on: ubuntu-latest
@@ -27,6 +31,15 @@ jobs:
2731
echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
2832
shell: pwsh
2933

34+
- name: Add version to global.json
35+
run: |
36+
$version = "7.0.406"
37+
$globalJsonPath = "global.json"
38+
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
39+
$globalJson.sdk.version = $version
40+
$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath
41+
shell: pwsh
42+
3043
- name: Install .NET Core
3144
uses: actions/setup-dotnet@v4
3245
with:

.github/workflows/pull_request.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- master
1111
- dev
1212

13+
env:
14+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
15+
DOTNET_NOLOGO: true
16+
1317
jobs:
1418
build:
1519

@@ -28,6 +32,15 @@ jobs:
2832
with:
2933
dotnet-version: ${{ matrix.dotnet }}
3034

35+
- name: Add version to global.json
36+
run: |
37+
$version = "${{ matrix.dotnet }}"
38+
$globalJsonPath = "global.json"
39+
$globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json
40+
$globalJson.sdk.version = $version
41+
$globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath
42+
shell: pwsh
43+
3144
- name: Install local tools
3245
run: dotnet tool restore
3346

0 commit comments

Comments
 (0)