workflow fix #46
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: NuGet package publish | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
upload-to-npgk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9 | |
- name: Setup NuGet.exe for use with actions | |
uses: NuGet/[email protected] | |
with: | |
nuget-version: latest | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --framework net9.0 --no-build --verbosity normal | |
- name: Pack | |
# CHANGE PACKAGE VERSION - The retarded way | |
# Change the /p:VERSION=X.X.X part to change the actual package version. | |
run: dotnet pack --configuration Release /p:VERSION=1.0.0.${{ github.run_number }} --version-suffix ${{ github.sha }} | |
- name: Upload to NuGet | |
run: dotnet nuget push /home/runner/work/cs-x39-util/cs-x39-util/X39.Util/bin/Release/X39.Util.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} |