-
-
Notifications
You must be signed in to change notification settings - Fork 126
57 lines (45 loc) · 1.25 KB
/
create-nuget-package.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
name: Create NuGet Package
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Build CSS
run: npx grunt less:prod
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Install NuGet CLI
run: |
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
chmod +x nuget.exe
- name: Create NuGet package
run: |
mono nuget.exe pack .nuspec
- name: List NuGet package contents
run: |
unzip -l *.nupkg
- name: Verify CSS file exists
run: |
if [ ! -f "css/evol-colorpicker.min.css" ]; then
echo "CSS file not found!"
exit 1
fi
- name: Upload NuGet package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
mono nuget.exe push *.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey $NUGET_API_KEY