From 1e3e7dfac8c0887bc3c5758c35fce5ad9b4ebef3 Mon Sep 17 00:00:00 2001 From: Karl-Philipp Wulfert Date: Fri, 17 May 2019 16:53:42 +0200 Subject: [PATCH] feat: add rules to enforce automatic package publishing References #18 --- src/common.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/common.ts b/src/common.ts index 7d55302a..8aec4516 100644 --- a/src/common.ts +++ b/src/common.ts @@ -589,6 +589,17 @@ export function getRules(configuration: Configuration): Rules { 'node_modules', ], }, + build: { + stage: 'build', + script: [ + 'npm run build', + ], + artifacts: { + paths: [ + 'lib', + ], + }, + }, audit: { allow_failure: true, except: [ @@ -608,6 +619,27 @@ export function getRules(configuration: Configuration): Rules { ], stage: 'test', }, + package: { + dependencies: [ + 'build', + ], + tags: [ + 'secrecy', + ], + stage: 'deploy', + script: [ + 'echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > /root/.npmrc', + 'npm publish', + ], + only: [ + '/^v[0-9]+\.[0-9]+\.[0-9]+$/', + ], + artifacts: { + paths: [ + 'public', + ], + }, + }, pages: { artifacts: { 'paths': [