-
-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (51 loc) · 2.21 KB
/
push-nuget.yml
File metadata and controls
62 lines (51 loc) · 2.21 KB
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
name: Publish NuGet Packages
on:
push:
tags:
- 1.**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install .NET workloads
run: dotnet workload install android
- name: Restore dependencies
run: |
dotnet restore HexaGen.Core/HexaGen.Core.csproj
dotnet restore HexaGen.Language/HexaGen.Language.csproj
dotnet restore HexaGen/HexaGen.csproj
dotnet restore HexaGen.Runtime/HexaGen.Runtime.csproj
dotnet restore HexaGen.Runtime.COM/HexaGen.Runtime.COM.csproj
- name: Build the project
run: |
dotnet build HexaGen.Core/HexaGen.Core.csproj --configuration Release
dotnet build HexaGen.Language/HexaGen.Language.csproj --configuration Release
dotnet build HexaGen/HexaGen.csproj --configuration Release
dotnet build HexaGen.Runtime/HexaGen.Runtime.csproj --configuration Release
dotnet build HexaGen.Runtime.COM/HexaGen.Runtime.COM.csproj --configuration Release
- name: Pack the project
run: |
dotnet pack HexaGen.Core/HexaGen.Core.csproj --configuration Release --output ./nupkgs
dotnet pack HexaGen.Language/HexaGen.Language.csproj --configuration Release --output ./nupkgs
dotnet pack HexaGen/HexaGen.csproj --configuration Release --output ./nupkgs
dotnet pack HexaGen.Runtime/HexaGen.Runtime.csproj --configuration Release --output ./nupkgs
dotnet pack HexaGen.Runtime.COM/HexaGen.Runtime.COM.csproj --configuration Release --output ./nupkgs
- name: List packages
run: ls ./nupkgs/
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish the package
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate