2022-11-18 17:04:32 +00:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs: {}
|
|
|
|
#push:
|
|
|
|
# branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-23 17:46:13 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-18 17:04:32 +00:00
|
|
|
- name: Setup .NET
|
2023-09-23 17:46:13 +00:00
|
|
|
uses: actions/setup-dotnet@v3
|
2022-11-18 17:04:32 +00:00
|
|
|
with:
|
|
|
|
dotnet-version: 7.0.x
|
|
|
|
- uses: nuget/setup-nuget@v1
|
|
|
|
with:
|
|
|
|
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
|
|
|
|
nuget-version: '6.x'
|
|
|
|
- name: Restore dependencies
|
|
|
|
run: dotnet restore
|
|
|
|
- name: Build
|
|
|
|
run: dotnet build --no-restore
|
|
|
|
- name: Test
|
|
|
|
run: dotnet test --no-build --verbosity normal
|
|
|
|
- name: Pack & Publish
|
|
|
|
run: |
|
|
|
|
dotnet pack --version-suffix "build${{ github.run_number }}" -c Release .\SDL2-CS.csproj -o .
|
|
|
|
$file_to_publish = Get-ChildItem -Path $dir -Filter *.nupkg | Select -First 1
|
|
|
|
echo $file_to_publish
|
|
|
|
nuget push $file_to_publish -Source https://api.nuget.org/v3/index.json
|