Merge pull request #36 from Doprez/master #12
Workflow file for this run
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
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" |