-
Notifications
You must be signed in to change notification settings - Fork 38
63 lines (48 loc) · 1.85 KB
/
dotnet.yml
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
61
62
63
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
VERSION: 6.2.${{ github.run_number }}
CLI_VERSION: 2.2.${{ github.run_number }}
NUGET_INDEX: https://api.nuget.org/v3/index.json
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Release DLL version
run: echo ${{env.VERSION}}
- name: Release CLI version
run: echo ${{env.CLI_VERSION}}
- name: Setup .NET Core 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET Core 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET Core 8.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Integrated Tests
run: dotnet test ./tests/**/*.IntegratedTests.csproj --no-restore
- name: Publish DLL Artifact
if: github.ref == 'refs/heads/main'
run: |
dotnet pack ./src/C4Sharp/C4Sharp.csproj --no-restore --configuration ${{ env.BUILD_TYPE }} -p:PackageVersion=${{ env.VERSION }}
dotnet nuget push ./src/C4Sharp/**/*.${{ env.VERSION }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_INDEX }}
- name: Publish CLI Artifact
if: github.ref == 'refs/heads/main'
run: |
dotnet pack ./src/C4Sharp.Tools/C4Sharp.Tools.csproj --no-restore --configuration ${{ env.BUILD_TYPE }} -p:PackageVersion=${{ env.CLI_VERSION }}
dotnet nuget push ./src/C4Sharp.Tools/**/*.${{ env.CLI_VERSION }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_INDEX }}