-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.9 KB
/
ci-build.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
name: Build KanjiVG.Animation
on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]
workflow_dispatch:
env:
Configuration: RELEASE
ArtifactsName: nuget
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: NuGet restore
run: dotnet restore
- name: Build
run: dotnet build -c ${{ env.Configuration }} -v m --no-restore
- name: Run tests
run: dotnet test -c ${{ env.Configuration }} -v m --no-restore --no-build
- name: Create NuGet Artifacts
uses: actions/[email protected]
with:
name: ${{ env.ArtifactsName }}
path: '**/*.nupkg'
release:
runs-on: ubuntu-latest
needs: build
if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download NuGet Artifacts
uses: actions/[email protected]
with:
name: ${{ env.ArtifactsName }}
- name: NuGet push
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
NUGET_SOURCE_URL: https://api.nuget.org/v3/index.json
PACKAGE_GITHUB_AUTH_TOKEN: ${{ secrets.PACKAGE_GITHUB_API_KEY }}
PACKAGE_GITHUB_SOURCE_URL: https://nuget.pkg.github.com/MyNihongo/index.json
run: |
dotnet nuget push -s ${{ env.NUGET_SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg
dotnet nuget push -s ${{ env.PACKAGE_GITHUB_SOURCE_URL }} -k ${{ env.PACKAGE_GITHUB_AUTH_TOKEN }} **/*.nupkg