Skip to content

Commit bd8d878

Browse files
committed
Add package selection to publish workflows
1 parent 833687d commit bd8d878

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/publish-artifacts.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ on:
1919
description: "Optional manual version for ModularityKit.Mutator.Governance.Redis."
2020
required: false
2121
type: string
22+
publish_core:
23+
description: "Pack ModularityKit.Mutator."
24+
required: false
25+
type: boolean
26+
default: true
27+
publish_governance:
28+
description: "Pack ModularityKit.Mutator.Governance."
29+
required: false
30+
type: boolean
31+
default: true
32+
publish_redis:
33+
description: "Pack ModularityKit.Mutator.Governance.Redis."
34+
required: false
35+
type: boolean
36+
default: true
2237

2338
permissions:
2439
contents: read
@@ -80,7 +95,14 @@ jobs:
8095
echo "governance_version=$governance_version" >> "$GITHUB_OUTPUT"
8196
echo "redis_version=$redis_version" >> "$GITHUB_OUTPUT"
8297
98+
- name: Validate package selection
99+
if: ${{ inputs.publish_core != true && inputs.publish_governance != true && inputs.publish_redis != true }}
100+
run: |
101+
echo "At least one package must be selected for packing." >&2
102+
exit 1
103+
83104
- name: Pack core package
105+
if: ${{ inputs.publish_core == true }}
84106
run: >
85107
dotnet pack src/ModularityKit.Mutator.csproj
86108
-c Release
@@ -89,6 +111,7 @@ jobs:
89111
-p:PackageVersion=${{ steps.version.outputs.core_version }}
90112
91113
- name: Pack governance package
114+
if: ${{ inputs.publish_governance == true }}
92115
run: >
93116
dotnet pack src/ModularityKit.Mutator.Governance.csproj
94117
-c Release
@@ -97,6 +120,7 @@ jobs:
97120
-p:PackageVersion=${{ steps.version.outputs.governance_version }}
98121
99122
- name: Pack Redis governance package
123+
if: ${{ inputs.publish_redis == true }}
100124
run: >
101125
dotnet pack src/Redis/ModularityKit.Mutator.Governance.Redis.csproj
102126
-c Release

.github/workflows/publish-packages.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ on:
1919
description: Optional manual version for ModularityKit.Mutator.Governance.Redis
2020
required: false
2121
type: string
22+
publish_core:
23+
description: Publish ModularityKit.Mutator
24+
required: false
25+
default: true
26+
type: boolean
27+
publish_governance:
28+
description: Publish ModularityKit.Mutator.Governance
29+
required: false
30+
default: true
31+
type: boolean
32+
publish_redis:
33+
description: Publish ModularityKit.Mutator.Governance.Redis
34+
required: false
35+
default: true
36+
type: boolean
2237
publish_nuget:
2338
description: Publish to NuGet.org
2439
required: false
@@ -47,6 +62,21 @@ on:
4762
description: Optional manual version for ModularityKit.Mutator.Governance.Redis
4863
required: false
4964
type: string
65+
publish_core:
66+
description: Publish ModularityKit.Mutator
67+
required: false
68+
type: boolean
69+
default: true
70+
publish_governance:
71+
description: Publish ModularityKit.Mutator.Governance
72+
required: false
73+
type: boolean
74+
default: true
75+
publish_redis:
76+
description: Publish ModularityKit.Mutator.Governance.Redis
77+
required: false
78+
type: boolean
79+
default: true
5080
publish_nuget:
5181
description: Publish to NuGet.org
5282
required: false
@@ -68,6 +98,9 @@ jobs:
6898
core_version: ${{ inputs.core_version }}
6999
governance_version: ${{ inputs.governance_version }}
70100
redis_version: ${{ inputs.redis_version }}
101+
publish_core: ${{ inputs.publish_core }}
102+
publish_governance: ${{ inputs.publish_governance }}
103+
publish_redis: ${{ inputs.publish_redis }}
71104

72105
publish-nuget:
73106
name: Publish to NuGet.org

0 commit comments

Comments
 (0)