Skip to content

Commit 3eab36b

Browse files
authored
Let Snippets 5000 use .NET 9 SDK (#9947)
1 parent 51035a3 commit 3eab36b

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

.github/workflows/snippets5000.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# This is a basic workflow to help you get started with Actions
21
name: 'Snippets 5000'
32

43
# Controls when the action will run. Triggers the workflow on push or pull request
@@ -10,45 +9,41 @@ on:
109
workflow_dispatch:
1110
inputs:
1211
reason:
13-
description: 'The reason for running the workflow'
12+
description: 'Run Snippets 5000 to compile code'
1413
required: true
1514
default: 'Manual run'
1615

1716
env:
18-
DOTNET_INSTALLER_CHANNEL: '8.0'
19-
DOTNET_DO_INSTALL: 'false' # True to install preview versions, False to use the pre-installed (released) SDK
17+
DOTNET_VERSION: '9.0.*'
18+
DOTNET_QUALITY: 'preview'
19+
DOTNET_DO_INSTALL: 'true' # To install a version of .NET not provided by the runner, set to true
2020
EnableNuGetPackageRestore: 'True'
21-
repo: 'dotnet-api-docs'
2221

23-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2422
jobs:
25-
# This workflow contains a single job called "snippets-build"
2623
snippets-build:
27-
# The type of runner that the job will run on
2824
runs-on: windows-2022
2925
permissions:
3026
statuses: write
3127

32-
# Steps represent a sequence of tasks that will be executed as part of the job
3328
steps:
34-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
35-
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #@v3.1.0
29+
# Check out the repository for the PR
30+
- name: Check out repository
31+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b #@v4.1.5
3632

3733
# Get the latest preview SDK (or sdk not installed by the runner)
38-
- name: Setup .NET SDK
34+
- name: Set up .NET SDK
3935
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
40-
run: |
41-
echo "Downloading dotnet-install.ps1"
42-
Invoke-WebRequest https://raw.githubusercontent.com/dotnet/install-scripts/master/src/dotnet-install.ps1 -OutFile dotnet-install.ps1
43-
echo "Installing dotnet version ${{ env.DOTNET_INSTALLER_CHANNEL }}"
44-
.\dotnet-install.ps1 -InstallDir "c:\program files\dotnet" -Channel "${{ env.DOTNET_INSTALLER_CHANNEL }}" -Quality preview
36+
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 #@4.0.0
37+
with:
38+
dotnet-version: ${{ env.DOTNET_VERSION }}
39+
dotnet-quality: ${{ env.DOTNET_QUALITY }}
4540

4641
# Print dotnet info
4742
- name: Display .NET info
4843
run: |
4944
dotnet --info
5045
51-
# Clone docs tools repo
46+
# Clone docs-tools repo
5247
- name: Clone docs-tools repository
5348
run: |
5449
git clone https://github.com/dotnet/docs-tools
@@ -58,11 +53,4 @@ jobs:
5853
env:
5954
GitHubKey: ${{ secrets.GITHUB_TOKEN }}
6055
run: |
61-
dotnet run --project docs-tools\snippets5000\Snippets5000\Snippets5000.csproj -- --sourcepath "${{ github.workspace }}" --pullrequest ${{ github.event.number }} --owner ${{ github.repository_owner }} --repo ${{ github.event.repository.name }}
62-
63-
# Update build output json file
64-
- name: Upload build results
65-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #@v3.1.2
66-
with:
67-
name: build
68-
path: ./output.json
56+
dotnet run --project docs-tools/snippets5000/Snippets5000/Snippets5000.csproj -- --sourcepath "${{ github.workspace }}" --pullrequest ${{ github.event.number }} --owner ${{ github.repository_owner }} --repo ${{ github.event.repository.name }}

0 commit comments

Comments
 (0)