-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (44 loc) · 1.29 KB
/
Copy pathmain.yml
File metadata and controls
53 lines (44 loc) · 1.29 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
name: Build & Test
on:
push:
branches:
- main
workflow_dispatch:
#inputs:
#publish:
#description: 'Publish NuGet package?'
#required: true
#default: 'false'
jobs:
build-and-publish:
runs-on: windows-latest
env:
PROJECT_NAME: InterReact
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore --no-cache
- name: Build
run: dotnet build --configuration Release --no-restore
#- name: Test
#run: dotnet test --configuration Release --no-build
- name: Pack
shell: pwsh
run: dotnet pack ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj `
--configuration Release `
--no-restore --no-build `
-o ./artifacts
- name: List artifacts
shell: pwsh
run: Get-ChildItem ./artifacts
- name: Publish to NuGet
if: github.event.inputs.publish == 'true'
shell: pwsh
run: |
$pkg = Get-ChildItem ./artifacts/*.nupkg | Select-Object -First 1
dotnet nuget push $pkg.FullName `
--api-key ${{ secrets.NUGET_API_KEY }} `
--source https://api.nuget.org/v3/index.json