diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa9ddcbad1d3f426b898de997ee10e5975b29e2f..1955a769b663e165c6c91fc7c0f8352b1d8694d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,3 +28,8 @@ include: - template: Security/SAST.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml - template: Security/Secret-Detection.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/Secret-Detection.gitlab-ci.yml +# Cache rush's temp directory so that dependencies don't need to be installed multiple times +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - common/temp diff --git a/.gitlab-ci/publish.yml b/.gitlab-ci/publish.yml index f9b45b0ca30955c7b38cd7648d18440728bce388..fbe044f3eba2383cfa8393c9eb522316cdd4d2a6 100644 --- a/.gitlab-ci/publish.yml +++ b/.gitlab-ci/publish.yml @@ -10,6 +10,9 @@ publish-core: - git config user.email "${GITLAB_USER_EMAIL}" - git config user.name "${GITLAB_USER_NAME}" + # We shouldn't have to run `rush install` to get pnpm installed because directory `common/temp` is cached + # - node common/scripts/install-run-rush.js install + - echo 'Publishing...' - node common/scripts/install-run-rush.js publish -a -p dependencies: diff --git a/common/config/rush/pnpmfile.js b/common/config/rush/pnpmfile.js index 04652fbde3ca90d49bb75a8701a586c29efb4fd3..c73ba24918cd48e6828e6d0701e30e2a62eeb124 100644 --- a/common/config/rush/pnpmfile.js +++ b/common/config/rush/pnpmfile.js @@ -90,7 +90,9 @@ function readPackage(packageJson, context) { fs.writeFileSync( `${dbdRelativeToDirname}/package.json`, `{\n`+ - ` "name": "${pkg}"\n` + + ` "name": "${pkg}",\n` + + // Prevent accidental publication + ` "private": true\n` + `}\n` ); console.warn(