feat: add rules to enforce automatic package publishing

References #18
This commit is contained in:
Karl-Philipp Wulfert
2019-05-17 16:53:42 +02:00
parent 70b54164cd
commit 1e3e7dfac8

View File

@@ -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': [