Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 32 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ on:
merge_group:

env:
DOTNET_VERSION: ${{ '9.0.x' }}
DOTNET_VERSION: '9.0.310' # Only used by jobs that cannot access global.json (no checkout/artifact-only jobs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these cases it's only for nuget push, eh? Is there an alternate download/install way for the nuget tool vs. dotnet we could use to avoid tracking this version here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our options are:

  1. What we did here
  2. Hardcoding inline
  3. Cloning the repo so we have access to global.json

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting also duplicate with CommunityToolkit/Windows#827


ENABLE_DIAGNOSTICS: true
#COREHOST_TRACE: 1
MSBUILD_VERBOSITY: normal
Expand All @@ -40,11 +41,6 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -54,6 +50,11 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
Expand Down Expand Up @@ -145,11 +146,11 @@ jobs:
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpCount' -Type DWord -Value '10'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpType' -Type DWord -Value '2'
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
- name: Install .NET SDK
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
global-json-file: global.json

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
Expand Down Expand Up @@ -270,15 +271,6 @@ jobs:
VERSION_PROPERTY: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/release/')) && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -287,7 +279,16 @@ jobs:
ref: ${{ github.sha }}
fetch-depth: 0
fetch-tags: true


- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info

- name: Format Date/Time for Package Version (Tag builds only)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
Expand Down Expand Up @@ -396,7 +397,7 @@ jobs:
winui: [0, 2, 3]

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
Expand Down Expand Up @@ -461,7 +462,7 @@ jobs:
winui: [0, 2, 3]

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
Expand All @@ -486,15 +487,6 @@ jobs:
HEADS_DIRECTORY: tooling/ProjectHeads

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -504,6 +496,15 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info

# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
Expand All @@ -530,3 +531,5 @@ jobs:
with:
name: linux-logs
path: ./**/*.*log


4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "9.0.101",
"version": "9.0.310",
"rollForward": "latestFeature"
},
"msbuild-sdks":
"msbuild-sdks":
{
"MSBuild.Sdk.Extras":"3.0.23"
}
Expand Down