Skip to content

Commit 16926f9

Browse files
committed
feat: add ENABLE_INSTALLERS switch for installer pipeline control
- ENABLE_INSTALLERS (default true): controls Publish, PackageApp, and installer artifact upload/download via matrix.publish - Download installers step gated by ENABLE_INSTALLERS - Attestation subjects and GitHub Release assets adapt dynamically - GitHub Release works with or without installer zips Made-with: Cursor
1 parent 071201f commit 16926f9

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ env:
4141
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
4242
ENABLE_NUGET: 'true'
4343
NUGET_USE_OIDC: 'false'
44+
ENABLE_INSTALLERS: 'true'
4445
ENABLE_ANDROID: 'false'
4546
ENABLE_IOS: 'false'
4647

@@ -187,11 +188,12 @@ jobs:
187188
run: |
188189
IS_RELEASE="${{ steps.resolve.outputs.is_release }}"
189190
PACK=$( [ "$ENABLE_NUGET" = "true" ] && echo "true" || echo "false" )
191+
PUBLISH=$( [ "$ENABLE_INSTALLERS" = "true" ] && echo "true" || echo "false" )
190192
191193
if [ "$IS_RELEASE" = "true" ]; then
192-
ENTRIES="{\"os\":\"ubuntu-latest\",\"runtime\":\"linux-x64\",\"pack\":$PACK,\"publish\":true,\"workloads\":\"\"}"
193-
ENTRIES+=",{\"os\":\"windows-latest\",\"runtime\":\"win-x64\",\"pack\":false,\"publish\":true,\"workloads\":\"\"}"
194-
ENTRIES+=",{\"os\":\"macos-latest\",\"runtime\":\"osx-arm64\",\"pack\":false,\"publish\":true,\"workloads\":\"\"}"
194+
ENTRIES="{\"os\":\"ubuntu-latest\",\"runtime\":\"linux-x64\",\"pack\":$PACK,\"publish\":$PUBLISH,\"workloads\":\"\"}"
195+
ENTRIES+=",{\"os\":\"windows-latest\",\"runtime\":\"win-x64\",\"pack\":false,\"publish\":$PUBLISH,\"workloads\":\"\"}"
196+
ENTRIES+=",{\"os\":\"macos-latest\",\"runtime\":\"osx-arm64\",\"pack\":false,\"publish\":$PUBLISH,\"workloads\":\"\"}"
195197
196198
if [ "$ENABLE_ANDROID" = "true" ]; then
197199
ENTRIES+=',{"os":"ubuntu-latest","runtime":"android","pack":false,"publish":false,"workloads":"android"}'
@@ -444,6 +446,7 @@ jobs:
444446
path: artifacts/packages
445447

446448
- name: Download installers
449+
if: env.ENABLE_INSTALLERS == 'true'
447450
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
448451
with:
449452
path: artifacts/installers
@@ -534,9 +537,11 @@ jobs:
534537
SUBJECTS+="$f"$'\n'
535538
done
536539
fi
537-
for f in artifacts/installers/*.zip; do
538-
SUBJECTS+="$f"$'\n'
539-
done
540+
if [ "$ENABLE_INSTALLERS" = "true" ]; then
541+
for f in artifacts/installers/*.zip; do
542+
SUBJECTS+="$f"$'\n'
543+
done
544+
fi
540545
SUBJECTS=$(echo "$SUBJECTS" | sed '/^$/d')
541546
echo "subjects<<EOF" >> "$GITHUB_OUTPUT"
542547
echo "$SUBJECTS" >> "$GITHUB_OUTPUT"
@@ -583,27 +588,26 @@ jobs:
583588
TAG="${{ needs.resolve-version.outputs.tag }}"
584589
RELEASE_NAME="dotnet.CI.template $TAG"
585590
586-
shopt -s nullglob
587-
RELEASE_FILES=(artifacts/installers/*.zip)
588-
if [ ${#RELEASE_FILES[@]} -eq 0 ]; then
589-
echo "::error::No installer zip files found"
590-
exit 1
591-
fi
592-
593591
if gh release view "$TAG" >/dev/null 2>&1; then
594592
echo "::error::Release already exists for tag $TAG"
595593
exit 1
596594
fi
597595
598-
SBOM_FILE=""
596+
shopt -s nullglob
597+
RELEASE_ASSETS=()
598+
599+
if [ "$ENABLE_INSTALLERS" = "true" ]; then
600+
RELEASE_ASSETS+=(artifacts/installers/*.zip)
601+
fi
602+
599603
if [ -f "sbom-spdx.json" ]; then
600-
SBOM_FILE="sbom-spdx.json"
604+
RELEASE_ASSETS+=(sbom-spdx.json)
601605
fi
602606
603-
gh release create "$TAG" "${RELEASE_FILES[@]}" $SBOM_FILE \
607+
gh release create "$TAG" "${RELEASE_ASSETS[@]}" \
604608
--title "$RELEASE_NAME" \
605609
--generate-notes
606-
echo "Created release $TAG with ${#RELEASE_FILES[@]} assets"
610+
echo "Created release $TAG with ${#RELEASE_ASSETS[@]} assets"
607611
608612
deploy-docs:
609613
name: Deploy Documentation

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
3232
To publish an RC: trigger workflow_dispatch with prerelease_suffix=rc.1 -->
3333
<PropertyGroup>
34-
<VersionPrefix>0.2.5</VersionPrefix>
34+
<VersionPrefix>0.2.6</VersionPrefix>
3535
<FileVersion Condition="'$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
3636
</PropertyGroup>
3737

0 commit comments

Comments
 (0)