-
-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (82 loc) · 2.18 KB
/
publish.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
80
81
82
83
84
name: Publish
on:
release:
types: [published]
workflow_dispatch:
jobs:
restore-build-test-pack-push:
runs-on: ubuntu-latest
steps:
-
name: Prepare - Checkout Code
uses: actions/checkout@v3
-
name: Prepare - Read Version
uses: bfren/read-file@v2
with:
file: ./Version
id: version
-
name: Prepare - Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
-
name: A - Restore
run: |
dotnet restore Test.csproj
-
name: B - Build
run: |
dotnet build Test.csproj \
--no-restore \
--configuration Release
-
name: C - Test
run: |
dotnet test Test.csproj \
--no-restore \
--no-build \
--configuration Release
-
if: success()
name: D - Pack
run: |
dotnet pack Pack.csproj \
--no-build \
--configuration Release \
/p:PackageOutputPath=$HOME/.nupkgs \
-p:PackageVersion=${{ steps.version.outputs.contents }}
-
if: success()
name: E - Push
run: |
dotnet nuget push "$HOME/.nupkgs/*.nupkg" \
--skip-duplicate \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json
dotnet nuget push "$HOME/.nupkgs/*.nupkg" \
--skip-duplicate \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/bfren/index.json
-
if: success()
name: Finish - Success
uses: bfren/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Rqlite (GitHub)
SLACK_MESSAGE: Publish Succeeded
SLACK_COLOR: good
SLACK_ICON: https://bfren.dev/img/logo-square-500x500.jpg
-
if: failure()
name: Finish - Failure
uses: bfren/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Rqlite (GitHub)
SLACK_MESSAGE: Publish Failed
SLACK_COLOR: danger
SLACK_ICON: https://bfren.dev/img/logo-square-500x500.jpg