-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.5 KB
/
dotnet.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
name: Blazor Toolkit Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types:
- published
env:
project: src/AstroPanda.Blazor.Toolkit/AstroPanda.Blazor.Toolkit.csproj
test_project: test/AstroPanda.Blazor.Toolkit.Test/AstroPanda.Blazor.Toolkit.Test.csproj
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add GitHub Packages Source
run: |-
dotnet nuget add source https://nuget.pkg.github.com/astro-panda/index.json --name github --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text
- name: 🏥 Restore dependencies
run: dotnet restore ${{ env.project }}
- name: 🛠 Build
run: dotnet build ${{ env.project }} --no-restore -c Release
- name: 🧪 Test
run: dotnet test ${{ env.test_project }} --no-build --verbosity normal
- name: 📦 Package
if: github.event_name == 'release'
run: dotnet pack ${{ env.project }} --no-build -p:Version=${{ github.ref_name }} --output "${{ runner.temp }}"
- name: Publish to GitHub Packages
if: github.event_name == 'release'
run: |-
dotnet nuget push ${{ runner.temp }}/*.nupkg -s github
- name: Publish to NuGet
if: github.event_name == 'release' && always()
run: |-
dotnet nuget push ${{ runner.temp }}/*.nupkg -k ${{ secrets.NUGET_PUBLIC_API_KEY }} -s https://api.nuget.org/v3/index.json