Skip to content

GenerateReferences #4629

GenerateReferences

GenerateReferences #4629

name: GenerateReferences
on:
repository_dispatch:
types: [game_version_update]
schedule:
- cron: "0 */8 * * *"
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:
build:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: butr/actions-common-setup@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
- name: Setup .NET 5
uses: actions/setup-dotnet@master
with:
dotnet-version: 5.x.x
- name: Setup .NET 6
uses: actions/setup-dotnet@master
with:
dotnet-version: 6.x.x
- name: Install Tools
run: >-
dotnet tool install -g BepInEx.AssemblyPublicizer.Cli;
dotnet tool install -g FetchBannerlordVersion.Tool;
- name: Run Bannerlord.ReferenceAssemblies
run: >-
dotnet build src/DepotDownloader/DepotDownloader/DepotDownloader.csproj --configuration Release;
dotnet run --project src/Bannerlord.ReferenceAssemblies/Bannerlord.ReferenceAssemblies.csproj --configuration Release --steamLogin ${{secrets.STEAM_LOGIN}} --steamPassword ${{secrets.STEAM_PASSWORD}} --steamAppId 261550 --steamOS windows --steamOSArch 64 --steamDepotId 261551 261552 --feedUrl https://api.nuget.org/v3/index.json;
- name: Check files
id: check_files
run: echo "files_exists=$([[ "$(ls -A ./src/Bannerlord.ReferenceAssemblies/bin/Release/net8.0/final)" ]] && echo "true" || echo "false")" >> "$GITHUB_OUTPUT"
shell: bash
- name: Push to NuGet
if: steps.check_files.outputs.files_exists == 'true'
run: dotnet nuget push "./src/Bannerlord.ReferenceAssemblies/bin/Release/net8.0/final/*.nupkg" --skip-duplicate -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org
shell: pwsh
- name: Push to GPR
if: steps.check_files.outputs.files_exists == 'true'
run: |
for f in ./src/Bannerlord.ReferenceAssemblies/bin/Release/net8.0/final/*.nupkg
do
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/
done
shell: bash
- name: Dispatch
uses: guilouro/multiple-repositories-dispatch@master
if: steps.check_files.outputs.files_exists == 'true'
with:
repo_token: ${{secrets.REPO_ACCESS_TOKEN}}
repositories: |
BUTR/Bannerlord.ReferenceAssemblies.Documentation
BUTR/Bannerlord.Harmony
BUTR/Bannerlord.UIExtenderEx
BUTR/Bannerlord.ButterLib
Aragas/Bannerlord.MBOptionScreen
BUTR/Bannerlord.BLSE
BUTR/Bannerlord.BUTR.Shared
BUTR/Bannerlord.Python
BUTR/Bannerlord.PHP
BUTR/Bannerlord.DiscordRichPresence
BUTR/Bannerlord.PlayerSwitcher
BUTR/Bannerlord.YellToInspire
BUTR/Bannerlord.ReferenceAssemblies.Diff
event_type: game_version_update_patch
client_payload: '{"github": ${{ toJson(github) }}}'