Skip to content

Commit 9efb969

Browse files
committed
Enhance CI workflow to support 'norelease' label and adjust job conditions accordingly
1 parent 06d5522 commit 9efb969

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
fi
3333
3434
# Fail if neither preview nor release is set
35-
if [[ "$LABELS" != *"preview"* && "$LABELS" != *"release"* ]]; then
36-
echo "❌ PR must have either 'preview' or 'release' label."
35+
if [[ "$LABELS" != *"preview"* && "$LABELS" != *"release"* && "$LABELS" != *"norelease"* ]]; then
36+
echo "❌ PR must have 'preview', 'release' or 'norelease' label."
3737
exit 1
3838
fi
3939
@@ -52,6 +52,9 @@ jobs:
5252
else
5353
echo "BUMP=patch" >> $GITHUB_ENV
5454
fi
55+
56+
# Set NORELEASE as output of this step
57+
echo "NORELEASE=${{ env.NORELEASE }}" >> $GITHUB_ENV
5558
env:
5659
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5760

@@ -68,8 +71,11 @@ jobs:
6871

6972
outputs:
7073
new_version: ${{ steps.tag_bump.outputs.new_tag }}
74+
norelease: ${{ steps.tag_bump.outputs.norelease }}
75+
7176

7277
publish-types:
78+
if: needs.generate-version.outputs.norelease != 'true'
7379
uses: ./.github/workflows/reusable-publish.yml
7480
with:
7581
project_path: src/Blake.Types/Blake.Types.csproj
@@ -78,6 +84,7 @@ jobs:
7884
needs: generate-version
7985

8086
publish-markdownparser:
87+
if: needs.generate-version.outputs.norelease != 'true'
8188
uses: ./.github/workflows/reusable-publish.yml
8289
with:
8390
project_path: src/Blake.MarkdownParser/Blake.MarkdownParser.csproj
@@ -88,6 +95,7 @@ jobs:
8895
needs: [publish-types, generate-version]
8996

9097
publish-buildtools:
98+
if: needs.generate-version.outputs.norelease != 'true'
9199
uses: ./.github/workflows/reusable-publish.yml
92100
with:
93101
project_path: src/Blake.BuildTools/Blake.BuildTools.csproj
@@ -98,6 +106,7 @@ jobs:
98106
needs: [publish-markdownparser, generate-version]
99107

100108
publish-cli:
109+
if: needs.generate-version.outputs.norelease != 'true'
101110
uses: ./.github/workflows/reusable-publish.yml
102111
with:
103112
project_path: src/Blake.CLI/Blake.CLI.csproj

0 commit comments

Comments
 (0)