bug fix and improvement #92
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: Publish Pre-Release Version NuGet Package | |
on: | |
push: | |
branches: [master] | |
jobs: | |
test-build: | |
name: Test build on ${{ matrix.os }} .NET 9.0 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0 | |
- uses: actions/checkout@v4 | |
- name: Restore packages | |
run: dotnet restore ProjBobcat/ProjBobcat.sln | |
- name: Build Test | |
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore | |
publish-package: | |
name: Publish PreRelease package | |
runs-on: windows-latest | |
needs: [test-build] | |
if: needs.test-build.result == 'success' | |
steps: | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get previous tag | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: 1.0.0 | |
- name: Get current datetime | |
id: currentdatetime | |
uses: Kaven-Universe/github-action-current-date-time@v1 | |
with: | |
format: "YYYYMMDDHHmmssSSS" | |
- name: Restore packages | |
run: dotnet restore ProjBobcat/ProjBobcat/ProjBobcat.csproj | |
- name: Build the project | |
run: dotnet build ProjBobcat/ProjBobcat/ProjBobcat.csproj -c Release --no-restore | |
- name: Create the package | |
run: $tag="${{ steps.previoustag.outputs.tag }}".replace("v",""); dotnet pack ProjBobcat/ProjBobcat/ProjBobcat.csproj -c Release -p:PackageVersion="$tag-CI${{ steps.currentdatetime.outputs.time }}-beta" --no-build --no-restore -o . | |
- name: Publish the package to NuGet.org | |
run: dotnet nuget push *.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json |