Skip to content

Commit b29d1df

Browse files
author
Farid Amali | CM.com
committed
Added github workflows
1 parent 8278b81 commit b29d1df

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: .NET Build & Tests
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
name: Build and test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v2
17+
with:
18+
dotnet-version: |
19+
6.0.x
20+
7.0.x
21+
8.0.x
22+
- name: Restore dependencies
23+
run: dotnet restore
24+
- name: Build
25+
run: dotnet build --no-restore
26+
- name: Test
27+
run: dotnet test --no-build --verbosity normal

.github/workflows/nuget.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: .NET NuGET Publish
2+
3+
on:
4+
release:
5+
types: released
6+
7+
jobs:
8+
nugetpush:
9+
name: Build, test and push to NuGET
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v3
16+
with:
17+
dotnet-version: |
18+
6.0.x
19+
7.0.x
20+
8.0.x
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
- name: Build
24+
run: dotnet build --no-restore
25+
- name: Test
26+
run: dotnet test --no-build --verbosity normal
27+
- name: Publish to Nuget.org
28+
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.nuget_apikey }} -s https://api.nuget.org/v3/index.json
29+
- name: Add Github Packages source
30+
run: dotnet nuget add source --username cmdotcom --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/cmdotcom/index.json"
31+
- name: Publish to Github Packages
32+
run: dotnet nuget push **/*.nupkg -s github

CM.Voice.VoiceApi.Sdk.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
.gitignore = .gitignore
1414
LICENSE.md = LICENSE.md
1515
README.md = README.md
16+
.github/workflows/main.yml = .github/workflows/main.yml
17+
.github/workflows/nuget.yml = .github/workflows/nuget.yml
1618
EndProjectSection
1719
EndProject
1820
Global

0 commit comments

Comments
 (0)