From 1737829d3b459ad31bb0df2b7a6e64d74f618a1d Mon Sep 17 00:00:00 2001 From: Andrii Chebukin Date: Sun, 25 Feb 2024 16:57:17 +0400 Subject: [PATCH] Set version to `global.json` --- .github/workflows/publish_ci.yml | 13 +++++++++++++ .github/workflows/publish_release.yml | 13 +++++++++++++ .github/workflows/pull_request.yml | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/.github/workflows/publish_ci.yml b/.github/workflows/publish_ci.yml index 58fd0da0e..9b3859fa5 100644 --- a/.github/workflows/publish_ci.yml +++ b/.github/workflows/publish_ci.yml @@ -5,6 +5,10 @@ on: branches: - dev +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: true + jobs: publish: @@ -25,6 +29,15 @@ jobs: echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh + - name: Add version to global.json + run: | + $version = "7.0.406" + $globalJsonPath = "global.json" + $globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json + $globalJson.sdk.version = $version + $globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath + shell: pwsh + - name: Install .NET Core uses: actions/setup-dotnet@v4 with: diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index d3cd9e640..447db7f22 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -5,6 +5,10 @@ on: tags: - 'releases/*' +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: true + jobs: publish: runs-on: ubuntu-latest @@ -27,6 +31,15 @@ jobs: echo "VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh + - name: Add version to global.json + run: | + $version = "7.0.406" + $globalJsonPath = "global.json" + $globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json + $globalJson.sdk.version = $version + $globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath + shell: pwsh + - name: Install .NET Core uses: actions/setup-dotnet@v4 with: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 64051ab8d..5059e5808 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,6 +10,10 @@ on: - master - dev +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: true + jobs: build: @@ -28,6 +32,15 @@ jobs: with: dotnet-version: ${{ matrix.dotnet }} + - name: Add version to global.json + run: | + $version = "${{ matrix.dotnet }}" + $globalJsonPath = "global.json" + $globalJson = Get-Content -Raw -Path $globalJsonPath | ConvertFrom-Json + $globalJson.sdk.version = $version + $globalJson | ConvertTo-Json -Depth 10 | Set-Content -Path $globalJsonPath + shell: pwsh + - name: Install local tools run: dotnet tool restore