Skip to content

Commit

Permalink
📝 Chore: Merge pull request #86 from Crequency/dev=main
Browse files Browse the repository at this point in the history
[Pull Request] 📝 Chore: 更先进的 CI 流程控制 ()
  • Loading branch information
Dynesshely authored Aug 16, 2022
2 parents 380eba9 + 87f68c8 commit 7575a8d
Showing 1 changed file with 53 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 7575a8d

Please sign in to comment.