-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
20 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,66 @@ | ||
name: Publish on NuGet/GPR | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
uses: JoeFwd/Bannerlord.ExpandedTemplate/.github/workflows/test.yml@main | ||
secrets: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
publish-on-github: | ||
|
||
name: Publish Module on NuGet/GPR | ||
build-module: | ||
runs-on: ubuntu-latest | ||
needs: ["run-tests"] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Build | ||
run: | | ||
artifact=$(pwd)/bannerlord | ||
mkdir -p $artifact; | ||
proj="Bannerlord.ExpandedTemplate.Integration/Bannerlord.ExpandedTemplate.Integration.csproj"; | ||
dotnet clean $proj --configuration Release; | ||
dotnet build $proj --configuration Release -p:GameFolder="$artifact"; | ||
- name: Pack | ||
run: dotnet pack --configuration Release -o "./packages" | ||
- name: Install Bannerlord.ChangelogParser | ||
run: dotnet tool install -g Bannerlord.ChangelogParser; | ||
shell: pwsh | ||
|
||
- name: Push to NuGet | ||
run: dotnet nuget push "./packages/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://www.nuget.org --skip-duplicate | ||
shell: pwsh | ||
|
||
- name: Run ChangelogParser | ||
id: changelog | ||
run: | | ||
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: Bannerlord.ExpandedTemplate.API/Bannerlord.ExpandedTemplate.API.csproj | ||
# secrets: | ||
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
|
||
########################### | ||
# GITHUB # | ||
########################### | ||
publish-on-github: | ||
needs: [ "build-module" ] | ||
uses: BUTR/workflows/.github/workflows/release-github.yml@master | ||
with: | ||
mod_id: Bannerlord.ExpandedTemplate | ||
mod_version: ${{ needs.build-module.outputs.mod_version }} | ||
mod_description: ${{ needs.build-module.outputs.mod_description }} | ||
artifact_name: bannerlord |
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