-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (41 loc) · 1.35 KB
/
master_chrome_native_messaging.yaml
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
name: Build & Publish NuGet package (Chrome.NativeMessaging)
on:
push:
branches: [ master ]
paths:
- 'Chrome.NativeMessaging/**'
defaults:
run:
shell: bash
working-directory: Chrome.NativeMessaging
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Run Unit Tests
run: dotnet test -c Release --no-restore --verbosity normal
- name: Pack NuGet package
run: dotnet pack -c Release --no-build
- name: Create Git tag
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@github.io"
export TAG=$(basename $(ls Chrome.NativeMessaging/bin/Release/Chrome.NativeMessaging.*) .nupkg)
echo "Will create tag '$TAG'"
git tag -a $TAG -m "$(git log -1 --pretty=%B)"
git push origin $TAG
- name: Push to NuGet.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push $(ls ./Chrome.NativeMessaging/bin/Release/Chrome.NativeMessaging.*) -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json