Skip to content

Commit e1be29d

Browse files
committed
Initial Commit.
0 parents  commit e1be29d

13 files changed

Lines changed: 975 additions & 0 deletions

.github/workflows/deploy-nuget.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Deploy to Nuget
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
7+
env:
8+
NUGET_API_URL: https://api.nuget.org/v3/index.json
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 6.0.x
19+
- name: Restore dependencies
20+
run: dotnet restore
21+
- name: Build
22+
run: dotnet build --no-restore
23+
- name: Pack
24+
run: |
25+
BRANCH="${GITHUB_REF##*/}"
26+
COMMINT_SHORT_SHA=`git rev-parse --short ${GITHUB_SHA}`
27+
if [ "$BRANCH" = "main" ]; then
28+
dotnet pack --no-dependencies -c Release
29+
else
30+
dotnet pack --no-dependencies -c Debug --version-suffix ${BRANCH}-${COMMINT_SHORT_SHA}
31+
fi
32+
- name: Find Package
33+
run: |
34+
mkdir -p ./packages
35+
find ** -type f -regex '.*\.s?nupkg' -exec mv {} ./packages/ \;
36+
- uses: actions/upload-artifact@v2
37+
with:
38+
name: packages
39+
path: ./packages
40+
41+
deploy:
42+
runs-on: ubuntu-latest
43+
needs: build
44+
steps:
45+
- uses: actions/download-artifact@v2
46+
with:
47+
name: packages
48+
- name: Setup .NET
49+
uses: actions/setup-dotnet@v1
50+
with:
51+
dotnet-version: 6.0.x
52+
- name: Push packages
53+
run: find ** -type f -regex '.*\.s?nupkg' -exec dotnet nuget push -s ${{ env.NUGET_API_URL }} -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate {} \;

0 commit comments

Comments
 (0)