-
-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (31 loc) · 1.43 KB
/
publish_nightly.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
name: "Publish Nightly"
on:
push:
branches:
- main
jobs:
publish_nightly:
runs-on: ubuntu-latest
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]') && !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[nuget-skip]')"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Setup .NET"
uses: "actions/setup-dotnet@v2"
with:
dotnet-version: 8.x
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test --no-build -c Release
- name: Clean up
run: dotnet clean -c Release
- name: "Build Nightly Nuget Package"
run: |
mkdir build
cd ./Json2SharpLib
dotnet build -p:PackageId=Json2Sharp -p:AssemblyName=Json2Sharp -c Release
dotnet pack --include-symbols --include-source -p:SymbolPackageFormat=snupkg -p:PackageId=Json2Sharp -p:AssemblyName=Json2Sharp -p:VersionSuffix='nightly-0${{ github.run_number }}' -p:BuildNumber=0$(( ${{ github.run_number }} )) -c Release -o ../build
cd ..
- name: "Publish Nightly Nuget Package"
run: "dotnet nuget push \"build/*\" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json" # If the package version does not comply with SemVer, it will be set as a pre-release version automatically.