Merge pull request #289 from BUTR/dev #72
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 Module | |
on: | |
push: | |
branches: | |
- master | |
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-module: | |
name: Build Module | |
runs-on: ubuntu-latest | |
outputs: | |
mod_version: ${{ steps.changelog.outputs.mod_version }} | |
mod_description: ${{ steps.changelog.outputs.mod_description }} | |
steps: | |
- name: Setup | |
uses: butr/actions-common-setup@v2 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
- name: Build Bannerlord.UIExtenderEx | |
run: >- | |
mkdir bannerlord; | |
dotnet build src/Bannerlord.UIExtenderEx/Bannerlord.UIExtenderEx.csproj --configuration Release -p:GameFolder="$PWD/bannerlord"; | |
shell: pwsh | |
- name: Install and Run ChangelogParser | |
id: changelog | |
run: | | |
dotnet tool install -g Bannerlord.ChangelogParser | |
vers="$(bannerlord_changelog_parser latestversion -f "$PWD/changelog.txt")" | |
echo "::set-output name=mod_version::$vers" | |
desc="$(bannerlord_changelog_parser fulldescription -f "$PWD/changelog.txt")" | |
desc="${desc//'%'/'%25'}" | |
desc="${desc//$'\n'/'%0A'}" | |
desc="${desc//$'\r'/'%0D'}" | |
echo "::set-output name=mod_description::$desc" | |
- name: Upload Bannerlord folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bannerlord | |
path: ./bannerlord/ | |
########################### | |
# NUGET/GPR # | |
########################### | |
publish-on-nuget: | |
needs: ["build-module"] | |
uses: BUTR/workflows/.github/workflows/release-nuget.yml@master | |
with: | |
project_path: src/Bannerlord.UIExtenderEx/Bannerlord.UIExtenderEx.csproj | |
secrets: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
########################### | |
# NEXUSMODS # | |
########################### | |
publish-on-nexusmods: | |
needs: ["build-module"] | |
uses: BUTR/workflows/.github/workflows/release-nexusmods.yml@master | |
with: | |
nexusmods_game_id: mountandblade2bannerlord | |
nexusmods_mod_id: 2102 | |
mod_filename: UIExtenderEx | |
mod_version: ${{ needs.build-module.outputs.mod_version }} | |
mod_description: ${{ needs.build-module.outputs.mod_description }} | |
artifact_name: bannerlord | |
secrets: | |
NEXUSMODS_APIKEY: ${{ secrets.ARAGAS_NEXUSMODS_API_KEY }} | |
NEXUSMODS_COOKIES: ${{ secrets.ARAGAS_NEXUSMODS_COOKIE_SID_DEVELOP }} | |
########################### | |
# STEAM # | |
########################### | |
publish-on-steam: | |
needs: ["build-module"] | |
uses: BUTR/workflows/.github/workflows/release-steam.yml@master | |
with: | |
workshop_id: 2859222409 | |
mod_id: Bannerlord.UIExtenderEx | |
mod_description: ${{ needs.build-module.outputs.mod_description }} | |
artifact_name: bannerlord | |
secrets: | |
STEAM_LOGIN: ${{ secrets.STEAM_WORKSHOP_LOGIN }} | |
STEAM_PASSWORD: ${{ secrets.STEAM_WORKSHOP_PASSWORD }} | |
STEAM_AUTH_CODE: ${{ secrets.STEAM_WORKSHOP_AUTH_CODE }} | |
########################### | |
# GITHUB # | |
########################### | |
publish-on-github: | |
needs: ["build-module"] | |
uses: BUTR/workflows/.github/workflows/release-github.yml@master | |
with: | |
mod_id: Bannerlord.UIExtenderEx | |
mod_version: ${{ needs.build-module.outputs.mod_version }} | |
mod_description: ${{ needs.build-module.outputs.mod_description }} | |
artifact_name: bannerlord |