-
Notifications
You must be signed in to change notification settings - Fork 22
65 lines (52 loc) · 1.99 KB
/
build.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build
on:
push:
pull_request:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: Build
if: "!contains(github.event.head_commit.message, 'skip-ci')"
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: |
cd src
dotnet restore
dotnet restore Templates\templatepack.csproj
- name: Build
run: |
cd src
dotnet build --configuration Release --no-restore
dotnet build Templates\templatepack.csproj --configuration Release --no-restore
- name: Pack
run: |
cd src
dotnet pack TinyLittleMvvm/TinyLittleMvvm.csproj --configuration Release --no-build --output .
dotnet pack TinyLittleMvvm.Analyzers/TinyLittleMvvm.Analyzers.csproj --configuration Release --no-build --output .
dotnet pack TinyLittleMvvm.MahAppsMetro/TinyLittleMvvm.MahAppsMetro.csproj --configuration Release --no-build --output .
dotnet pack Templates\templatepack.csproj --configuration Release --no-build --output .
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: nupkg
path: ./src/*.nupkg
- name: Publish to GitHub
run: |
cd src
dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --no-symbols --skip-duplicate
- name: Publish to NuGet
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
run: |
cd src
dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --no-symbols --skip-duplicate