-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 1.13 KB
/
ci.yml
File metadata and controls
39 lines (31 loc) · 1.13 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
# .github/workflows/ci.yml
name: Publish NuGet
on:
push:
tags: [ 'v*.*.*' ] # push when you create v1.2.3 tag
branches: [ main ] # or build every commit
workflow_dispatch: # manual button
jobs:
build-pack-push:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
fetch-depth: 0 # REQUIRED for MinVer
- name: Setup .NET (latest stable)
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5
with:
dotnet-version: 10.0.x
- name: Restore, build, test
run: |
dotnet restore
dotnet build --configuration Release
dotnet test --configuration Release
- name: Pack (incl. symbols)
run: dotnet pack src/ZaString --configuration Release --include-symbols
# ---------- publish to nuget.org ----------
- name: Push to nuget.org
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push **/*.nupkg --api-key "${{ secrets.NUGET_API_KEY_ZASTRING }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate