diff --git a/.circleci/config.yml b/.circleci/config.yml index e4bfcde10f..707003725f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -570,15 +570,25 @@ jobs: environment: NG_PACKAGES_DIR: &ng_packages_dir 'dist/packages-dist' NG_PACKAGES_ARCHIVES_DIR: &ng_packages_archives_dir 'dist/packages-dist-archives' + ZONEJS_PACKAGES_DIR: &zonejs_packages_dir 'dist/zone.js-dist' + ZONEJS_PACKAGES_ARCHIVES_DIR: &zonejs_packages_archives_dir 'dist/zone.js-dist-archives' steps: - custom_attach_workspace - init_environment + # Publish `@angular/*` packages. - run: - name: Create artifacts + 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 - 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 + - store_artifacts: + path: *zonejs_packages_archives_dir + destination: zone.js # This job updates the content of repos like github.com/angular/core-builds # for every green build on angular/angular. diff --git a/scripts/ci/create-package-archives.sh b/scripts/ci/create-package-archives.sh index 65f6a41dce..abcd1162c9 100755 --- a/scripts/ci/create-package-archives.sh +++ b/scripts/ci/create-package-archives.sh @@ -15,11 +15,14 @@ echo " Preparing output directory: $outputDir" rm -rf "$outputDir" mkdir -p "$outputDir" -# Create a compressed archive containing all packages. -# (This is useful for copying all packages into `node_modules/` (without changing `package.json`).) -outputFileName=all$fileSuffix -echo " Creating archive with all packages --> '$outputFileName'..." -tar --create --gzip --directory "$inputDir" --file "$outputDir/$outputFileName" --transform s/^\./packages/ . +# If there are more than one packages in `$inputDir`... +if [[ $(ls -1 "$inputDir" | wc -l) -gt 1 ]]; then + # Create a compressed archive containing all packages. + # (This is useful for copying all packages into `node_modules/` (without changing `package.json`).) + outputFileName=all$fileSuffix + echo " Creating archive with all packages --> '$outputFileName'..." + tar --create --gzip --directory "$inputDir" --file "$outputDir/$outputFileName" --transform s/^\./packages/ . +fi # Create a compressed archive for each package. # (This is useful for referencing the path/URL to the resulting archive in `package.json`.)