-
Notifications
You must be signed in to change notification settings - Fork 6
34 lines (29 loc) · 1022 Bytes
/
deploy.yml
File metadata and controls
34 lines (29 loc) · 1022 Bytes
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
name: Deploy
on:
release:
types:
- published
jobs:
publish:
name: Publish
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'master' }}
env:
BW_PROJECT_NAME: Bandwidth.Iris
BW_PROJECT_TEST_NAME: Bandwidth.Iris.Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "6.0"
- name: Run unit tests
run: dotnet test $BW_PROJECT_TEST_NAME
- name: Pack NuGet package
run: dotnet pack --configuration Release $BW_PROJECT_NAME -p:PackageVersion=$RELEASE_VERSION
- name: Publish NuGet package
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
NUGET_SOURCE: https://api.nuget.org/v3/index.json
run: dotnet nuget push $BW_PROJECT_NAME/bin/Release/*.nupkg -s $NUGET_SOURCE -k $NUGET_KEY