-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Upload package to NuGet | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
build: | ||
name: Upload package to NuGet | ||
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 | ||
run: dotnet restore | ||
- name: Set VERSION variable from tag | ||
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | ||
- name: Build | ||
run: | | ||
dotnet build -c Release --no-restore /p:Version=${VERSION} /p:PackageVersion=${VERSION} LibSceSharp | ||
dotnet build -c Release --no-restore /p:Version=${VERSION} /p:PackageVersion=${VERSION} LibSceSharp.Native | ||
- name: Pack | ||
run: | | ||
dotnet pack -c Release /p:Version=${VERSION} --no-restore --no-build LibSceSharp | ||
dotnet pack -c Release /p:Version=${VERSION} --no-restore --no-build LibSceSharp.Native | ||
- name: Upload Packages | ||
run: | | ||
dotnet nuget push LibSceSharp/bin/Release/LibSceSharp.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} | ||
dotnet nuget push LibSceSharp.Native/bin/Release/LibSceSharp.Native.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} | ||
env: | ||
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |