diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7625c91..ed44bf1 100755 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish on NuGet/GPR +name: Publish on: push: @@ -6,29 +6,61 @@ on: - 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 \ No newline at end of file + + - 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 \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 7ca7c30..fc2db3d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Game Versions: v1.2.11 * feat: pick random equipment from equipment pool for heroes and battle type * feat: add submodule for testing purposes * doc: add changelog +* ci: publish on github --------------------------------------------------------------------------------------------------- Version: 1.0.0 Game Versions: v1.2.11