Skip to content

Update Sdk.targets #108

Update Sdk.targets

Update Sdk.targets #108

Workflow file for this run

name: Publish
on:
push:
branches:
- master
paths:
- '.github/workflows/publish.yml'
- 'src/**'
- 'resources/**'
workflow_dispatch:
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
publish-on-nuget:
name: Publish on NuGet
runs-on: ubuntu-latest
steps:
- name: Setup
uses: butr/actions-common-setup@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Pack projects (Release)
run: >-
dotnet pack src/Bannerlord.BuildResources/Bannerlord.BuildResources.csproj --configuration Release -o "./packages";
dotnet pack src/Bannerlord.Module.Sdk/Bannerlord.Module.Sdk.csproj --configuration Release -o "./packages";
dotnet pack src/Bannerlord.BUTRModule.Sdk/Bannerlord.BUTRModule.Sdk.csproj --configuration Release -o "./packages";
dotnet pack src/Bannerlord.DataModule.Sdk/Bannerlord.DataModule.Sdk.csproj --configuration Release -o "./packages";
- name: Push to NuGet
run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
- name: Push to GPR
run: |
for f in ./packages/*.nupkg
do
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/
done