diff --git a/.circleci/config.yml b/.circleci/config.yml index 617fdc1c9f..92dbec87dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -578,14 +578,14 @@ jobs: # Publish `@angular/*` packages. - run: name: Create artifacts for @angular/* packages - command: ./scripts/ci/create-package-archives.sh $CI_PULL_REQUEST $CI_COMMIT $NG_PACKAGES_DIR $NG_PACKAGES_ARCHIVES_DIR + command: ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $NG_PACKAGES_DIR $NG_PACKAGES_ARCHIVES_DIR - store_artifacts: path: *ng_packages_archives_dir destination: angular # Publish `zone.js` package. - run: name: Create artifacts for zone.js package - command: ./scripts/ci/create-package-archives.sh $CI_PULL_REQUEST $CI_COMMIT $ZONEJS_PACKAGES_DIR $ZONEJS_PACKAGES_ARCHIVES_DIR + command: ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $ZONEJS_PACKAGES_DIR $ZONEJS_PACKAGES_ARCHIVES_DIR - store_artifacts: path: *zonejs_packages_archives_dir destination: zone.js diff --git a/scripts/ci/create-package-archives.sh b/scripts/ci/create-package-archives.sh index abcd1162c9..3099e07709 100755 --- a/scripts/ci/create-package-archives.sh +++ b/scripts/ci/create-package-archives.sh @@ -2,11 +2,11 @@ set -eu -o pipefail -readonly prNumber="$1" -readonly prLastSha="${2:0:7}" +readonly safeBranchName="$(echo $1 | sed 's/^pull\//pr/' | sed 's/[^A-Za-z0-9_.-]/_/g')" +readonly shortLastSha="$(git rev-parse --short $2)" readonly inputDir="$PROJECT_ROOT/$3" readonly outputDir="$PROJECT_ROOT/$4" -readonly fileSuffix="-pr$prNumber-$prLastSha.tgz" +readonly fileSuffix="-$safeBranchName-$shortLastSha.tgz" echo "Creating compressed archives for packages in '$inputDir'."