-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (47 loc) · 2.26 KB
/
CI.yml
File metadata and controls
60 lines (47 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI/CD
on:
push:
pull_request:
release:
types: [published]
jobs:
build:
name: Build, test, and deploy
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Setup .NET Core 3.1 SDK
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 3.1.x
- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 5.0.x
- name: Setup current .NET SDK
uses: actions/setup-dotnet@v1.8.2
- name: Test
run: dotnet test
- name: Create NuGet packages
run: dotnet pack -c Release -o nupkgs/
- name: Upload NuGet packages as artifacts
uses: actions/upload-artifact@v2
with:
name: nugets
path: nupkgs/
- name: Push NuGets to DevOps
if: github.event_name == 'push' && github.repository_owner == 'GmodNET'
run: |
dotnet nuget update source gmodnet-packages --username CI --password ${{ secrets.AZURE_DEVOPS_ARTIFACTS_PAT }} --store-password-in-clear-text
dotnet nuget push nupkgs/GmodNET.VersionTool.*.nupkg --source gmodnet-packages --skip-duplicate --api-key az
dotnet nuget push nupkgs/GmodNET.VersionTool.Core.*.nupkg --source gmodnet-packages --skip-duplicate --api-key az
dotnet nuget push nupkgs/GmodNET.VersionTool.MSBuild.*.nupkg --source gmodnet-packages --skip-duplicate --api-key az
dotnet nuget push nupkgs/GmodNET.VersionTool.SourceGenerator.*.nupkg --source gmodnet-packages --skip-duplicate --api-key az
- name: Push NuGets to NuGet.org
if: github.event_name == 'release' && github.event.action == 'published' && github.repository_owner == 'GmodNET'
run: |
dotnet nuget push nupkgs/GmodNET.VersionTool.*.nupkg --source nuget --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push nupkgs/GmodNET.VersionTool.Core.*.nupkg --source nuget --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push nupkgs/GmodNET.VersionTool.MSBuild.*.nupkg --source nuget --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
dotnet nuget push nupkgs/GmodNET.VersionTool.SourceGenerator.*.nupkg --source nuget --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}