-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (74 loc) · 2.39 KB
/
release.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
85
86
87
88
89
90
91
92
name: Release nuget and storybook on GH Pages
on:
push:
branches: ["main"]
workflow_dispatch:
env:
DOTNET_VERSION: "8.0.x"
NODE_VERSION: 20
NUGET_ORG: https://api.nuget.org/v3/index.json
jobs:
prepare-artifacts:
runs-on: ubuntu-latest
env:
PROJECT_PATH: "src/AdaptiveBlazor/AdaptiveBlazor.csproj"
STORYBOOK_PROJECT_PATH: "src/AdaptiveBlazor.Storybook/AdaptiveBlazor.Storybook.csproj"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install .NET WebAssembly Tools
run: dotnet workload install wasm-tools
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build sln
run: dotnet build --no-restore -c Release
- name: Pack nugets
run: dotnet pack ${{ env.PROJECT_PATH }} --no-build -c Release -o ./artifacts/nugets
- name: Generate storybook
run: dotnet publish ${{ env.STORYBOOK_PROJECT_PATH }} -c Release -o ./artifacts/storybook -p GHPages=true
- name: Upload nugets as artifacts
uses: actions/upload-artifact@v3
with:
name: nugets
path: ./artifacts/nugets
- name: Upload storybook as artifacts
uses: actions/upload-artifact@v3
with:
name: storybook
path: ./artifacts/storybook
push-to-nuget-org:
needs: prepare-artifacts
runs-on: ubuntu-latest
steps:
- name: Download nugets
uses: actions/download-artifact@v3
with:
name: nugets
- name: Setup NuGet.exe
uses: nuget/setup-nuget@v1
with:
nuget-version: 6.8.0
- name: Push nugets to github packages
run: nuget push "*.nupkg" -ApiKey ${{ secrets.NUGET_ORG_KEY }} -Source ${{ env.NUGET_ORG }} -SkipDuplicate
push-storybook-to-gh-pages:
needs: prepare-artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download storybook
uses: actions/download-artifact@v3
with:
name: storybook
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: wwwroot