diff --git a/.github/workflows/build-push-packages.yml b/.github/workflows/build-publish-packages.yml similarity index 59% rename from .github/workflows/build-push-packages.yml rename to .github/workflows/build-publish-packages.yml index 70508caf..093e77ae 100644 --- a/.github/workflows/build-push-packages.yml +++ b/.github/workflows/build-publish-packages.yml @@ -1,8 +1,17 @@ -name: Build And Push Packages +name: Publish Packages + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + workflow_dispatch: jobs: build-on-ubuntu: runs-on: ubuntu-latest + if: "contains(github.event.head_commit.message, '[Publish Packages]')" steps: @@ -23,7 +32,14 @@ jobs: with: nuget-version: '6.x' + + + + + + - name: Build Contracts + if: "contains(github.event.head_commit.message, '[KitX.Contract.CSharp]') || contains(github.event.head_commit.message, '[All]')" run: | cd "KitX Contracts" @@ -33,7 +49,24 @@ jobs: cd ".." + - name: Publish KitX.Contract.CSharp to GitHub and NuGet + if: "contains(github.event.head_commit.message, '[KitX.Contract.CSharp]') || contains(github.event.head_commit.message, '[All]'" + run: | + cd "KitX Build" + + nuget push ./Contracts/CSharp/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol + nuget push ./Contracts/CSharp/Release/*.nupkg -Source github -SkipDuplicate + + cd ".." + + + + + + + - name: Build Rules + if: "contains(github.event.head_commit.message, '[KitX.Web.Rules]' || contains(github.event.head_commit.message, '[All]')" run: | cd "KitX Rules" @@ -42,8 +75,25 @@ jobs: cd ".." cd ".." + + - name: Publish KitX.Web.Rules to GitHub and NuGet + if: "contains(github.event.head_commit.message, '[KitX.Web.Rules]' || contains(github.event.head_commit.message, '[All]')" + run: | + cd "KitX Build" + + nuget push ./Rules/Web.Rules/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol + nuget push ./Rules/Web.Rules/Release/*.nupkg -Source github -SkipDuplicate + + cd ".." + + + + + + - name: Build File Format Helper + if: "contains(github.event.head_commit.message, '[KitX.KXP.Helper]' || contains(github.event.head_commit.message, '[All]')" run: | cd "KitX File Format Helper" @@ -53,16 +103,11 @@ jobs: cd ".." - - name: Publish Package to GitHub and NuGet + - name: Publish KitX.KXP.Helper to GitHub and NuGet + if: "contains(github.event.head_commit.message, '[KitX.KXP.Helper]' || contains(github.event.head_commit.message, '[All]')" run: | cd "KitX Build" - nuget push ./Contracts/CSharp/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol - nuget push ./Contracts/CSharp/Release/*.nupkg -Source github -SkipDuplicate - - nuget push ./Rules/Web.Rules/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol - nuget push ./Rules/Web.Rules/Release/*.nupkg -Source github -SkipDuplicate - nuget push "./File Format Helper/KXP/Release/*.nupkg" -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol nuget push "./File Format Helper/KXP/Release/*.nupkg" -Source github -SkipDuplicate