1- name : .NET
1+ name : Build
22
33on :
44 pull_request :
55 branches : [ master ]
66 workflow_dispatch :
7+ push :
78
89jobs :
910 build :
1011 runs-on : windows-latest
1112
12- strategy :
13- matrix :
14- versions : [ 11.0.10, 11.1.0-beta1 ]
15-
1613 steps :
1714 - uses : actions/checkout@v2
1815 with :
1916 submodules : ' true'
20- - name : Install component on windows 2022
21- shell : pwsh
22- run : |
23- Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
24- $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
25- $componentsToAdd = @(
26- "Microsoft.Net.Component.4.6.1.SDK"
27- )
28- [string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
29- $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
30- $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
31- if ($process.ExitCode -eq 0)
32- {
33- Write-Host "components have been successfully added"
34- }
35- else
36- {
37- Write-Host "components were not installed"
38- exit 1
39- }
40- - name : Clean
41- run : dotnet clean
42- env :
43- AVA_VER : ${{ matrix.versions }}
44- - name : Restore
45- run : dotnet restore
17+ - name : Build Nuget packages
4618 env :
47- AVA_VER : ${{ matrix.versions }}
48- - name : Build
49- run : dotnet build --no-restore
19+ is_release : ${{ startsWith(github.ref, 'refs/tags/') }}
20+ run : |
21+ ls
22+ pwsh -ep Bypass -c ./tools/publish-nupkg.ps1 $env:is_release
23+ - name : Upload Nuget packages to GitHub registry
24+ if : ${{ github.event_name != 'pull_request' }}
5025 env :
51- AVA_VER : ${{ matrix.versions }}
52- - name : Test
53- run : dotnet test --no-build --verbosity normal
26+ GHPKG_KEY : ${{ secrets.GHPKG_KEY }}
27+ run : |
28+ dotnet nuget add source --username HelloWRC --password $env:GHPKG_KEY --store-password-in-clear-text --name github "https://nuget.pkg.github.com/ClassIsland/index.json"
29+ dotnet nuget push .\out\*.nupkg -k $env:GHPKG_KEY --source "github" --skip-duplicate
30+ - name : Upload Nuget packages to NuGet Gallery
31+ if : ${{ github.event.inputs.release_tag && github.event_name != 'pull_request' }}
5432 env :
55- AVA_VER : ${{ matrix.versions }}
33+ NUGET_KEY : ${{ secrets.NUGET_ORG_KEY }}
34+ run : |
35+ ls
36+ cd out
37+ dotnet nuget push *.nupkg -k $env:NUGET_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate
0 commit comments