Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pull Request] 更先进的 CI 流程控制 () #86

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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