-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (31 loc) · 1.1 KB
/
dotnet-nuget.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
name: Build nuget package
on:
push:
tags:
- 'v*.*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Determine Version
id: version
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
PACKAGE_VERSION=$(echo "${{ github.ref }}" | sed 's/^refs\/tags\/v//')
else
echo "Invalid tag format, setting default version..."
PACKAGE_VERSION=0.0.0.0
fi
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- name: Build
run: dotnet build ./Stride.BepuPhysics/Stride.BepuPhysics.csproj -p:Version=${{ env.PACKAGE_VERSION }} --no-restore
- name: Publish
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETAPIKEY}}
#run: dotnet nuget push **\*.nupkg --api-key ${{secrets.NUGETAPIKEY}} --source "github"