generated from easy-template/csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.26 KB
/
cd.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
name: CD
on:
push:
tags:
- v*
jobs:
Build-and-Tests:
name: Build and Test
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: running infrastructure
run: |
cd infrastructure
docker-compose up -d
sleep 2s
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.x.x
- name: Install dependencies
run: |
cd src
dotnet restore
- name: Build
run: |
cd src
dotnet build --configuration Debug --no-restore
- name: Test
run: |
cd src
dotnet test
- id: get_version
uses: seungyongshim/[email protected]
- name: Modification Version
run: |
cd src
sed -i "s/<Version>9999.0.0.000/<Version>${{ steps.get_version.outputs.version }}/g" ./Directory.Build.props
cat ./Directory.Build.props
- name: Generate NuGet packages
run: |
cd src
dotnet pack -c Release -o nugets
- name: Push packages to registry
run: |
cd src/nugets
dotnet nuget push "*.nupkg" -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json --skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.api }}