From a821e06e337fdeae6157849086f1ea461cecb0ed Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:25:04 +0000 Subject: [PATCH] ci: support publishing dev-skills to snapshot repository Updates the snapshot publishing script to package the contents of `skills/dev-skills` and publish them to the `angular/skills` repository. The changes include: - Ensuring the script always runs from the repository root. - Updating `publishRepo` to support an optional third argument for specifying a custom repository name (defaulting to `-builds`). - Implementing `publishDevSkills` to package individual skills at the root of the snapshot repository. (cherry picked from commit 293ac66a9f9e8c738138fd64ad8e35406623daa6) --- .../ci/publish-snapshot-build-artifacts.sh | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/scripts/ci/publish-snapshot-build-artifacts.sh b/scripts/ci/publish-snapshot-build-artifacts.sh index 23a4c14401f..5196654e632 100755 --- a/scripts/ci/publish-snapshot-build-artifacts.sh +++ b/scripts/ci/publish-snapshot-build-artifacts.sh @@ -4,6 +4,7 @@ set -x -u -e -o pipefail # Setup environment readonly thisDir=$(cd $(dirname $0); pwd) +cd "$thisDir/../.." function getBuildVersion { # Example of `STABLE_PROJECT_VERSION` for snapshots is: `21.0.0-next.7+sha-7134dfe` @@ -24,8 +25,8 @@ function getBuildVersion { function publishRepo { COMPONENT=$1 ARTIFACTS_DIR=$2 + BUILD_REPO=${3:-"${COMPONENT}-builds"} - BUILD_REPO="${COMPONENT}-builds" REPO_DIR="$(pwd)/tmp/${BUILD_REPO}" REPO_URL="https://github.com/${ORG}/${BUILD_REPO}.git" @@ -121,6 +122,32 @@ function publishPackages { echo "Finished publishing build artifacts" } +# Packaging and publishing dev-skills. +function publishDevSkills { + GIT_SCHEME=$1 + BRANCH=$2 + BUILD_VER=$3 + + echo "Publishing dev-skills..." + + # Create a temporary tree-ish that includes uncommitted changes. + # If no changes exist, git stash create returns empty, so we fall back to HEAD. + tree_ish=$(git stash create) + if [ -z "$tree_ish" ]; then + tree_ish="HEAD" + fi + + SKILLS_DIST="$(pwd)/dist/dev-skills-dist" + echo "Packaging dev-skills into $SKILLS_DIST..." + rm -rf "$SKILLS_DIST" + mkdir -p "$SKILLS_DIST" + + # This ensures that individual skills (like angular-developer) are at the root of the destination repo. + git archive "$tree_ish":"skills/dev-skills" | tar -x -C "$SKILLS_DIST" + + publishRepo "skills" "${SKILLS_DIST}" "skills" +} + function publishAllBuilds() { GIT_SCHEME="$1" @@ -133,6 +160,7 @@ function publishAllBuilds() { local buildVersion=`getBuildVersion` publishPackages $GIT_SCHEME $PACKAGES_DIST $CUR_BRANCH $buildVersion + publishDevSkills $GIT_SCHEME $CUR_BRANCH $buildVersion } # See docs/DEVELOPER.md for help