-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (43 loc) · 1.78 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
name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- run: |
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.CommitsSinceVersionSourcePadded }}"
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack with dotnet
run: |
dotnet pack src/AliceMQ.Rabbit/AliceMQ.Rabbit.csproj --output nuget-packages/rabbit --configuration Release -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}-alpha
dotnet pack src/AliceMQ.PubSub/AliceMQ.PubSub.csproj --output nuget-packages/pubsub --configuration Release -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}-alpha
- name: Push with dotnet
run: |
dotnet nuget push nuget-packages/rabbit/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
dotnet nuget push nuget-packages/pubsub/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json