-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (62 loc) · 2.51 KB
/
build.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: FastPacket Build
on:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Setup .NET 6 (SDK)
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Unit Tests
run: dotnet test
- name: Build
working-directory: src/Enclave.FastPacket
run: dotnet build -c Release /p:Version=${{ steps.gitversion.outputs.SemVer }}
- name: Clean Generator before proper build
working-directory: src/Enclave.FastPacket.Generator
run: dotnet clean
- name: Build Generator without Local Reference Workaround
working-directory: src/Enclave.FastPacket.Generator
run: dotnet build -c Release /p:Version=${{ steps.gitversion.outputs.SemVer }} /p:RemoveLocalReferenceWorkaround=true
- uses: actions/upload-artifact@v3
with:
name: generator-package
path: src/Enclave.FastPacket.Generator/bin/Release/Enclave.FastPacket.Generator.${{ steps.gitversion.outputs.SemVer }}.nupkg
- uses: actions/upload-artifact@v3
with:
name: fastpacket-package
path: src/Enclave.FastPacket/bin/Release/Enclave.FastPacket.${{ steps.gitversion.outputs.SemVer }}.nupkg
- name: Push Generator
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
working-directory: src/Enclave.FastPacket.Generator/bin/Release
run: |
dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Push FastPacket
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
working-directory: src/Enclave.FastPacket/bin/Release
run: |
dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.gitversion.outputs.SemVer }}
release_name: Release v${{ steps.gitversion.outputs.SemVer }}
body: Latest Enclave.FastPacket Release