This repository was archived by the owner on Nov 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +1338
-24
lines changed Expand file tree Collapse file tree 8 files changed +1338
-24
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,13 @@ jobs:
104104 file : " .coverage/*.json"
105105 - *slack_notification
106106
107- publish_dev_build :
107+ publish_build :
108108 << : *job_config
109109 steps :
110110 - *setup_envvars
111111 - *attach_workspace
112112 - run :
113- command : ./scripts/publish-nightly .sh
113+ command : ./scripts/publish.sh
114114 - *slack_notification
115115
116116# ###################################
@@ -139,7 +139,7 @@ workflows:
139139 - format :
140140 requires :
141141 - checkout_prepare_dependencies
142- - publish_dev_build :
142+ - publish_build :
143143 requires :
144144 - build
145145 - test
Original file line number Diff line number Diff line change 1+ {
2+ "git" : false ,
3+ "github" : {
4+ "release" : true
5+ },
6+ "npm" : {
7+ "publishConfig" : {
8+ "access" : " public"
9+ }
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ {
2+ "git" : {
3+ "commitMessage" : " Release ${version}" ,
4+ "requireBranch" : " develop"
5+ },
6+ "github" : {
7+ "release" : false
8+ },
9+ "npm" : {
10+ "publish" : false
11+ },
12+ "hooks" : { "before:init" : [" yarn format" , " yarn test" ] }
13+ }
Original file line number Diff line number Diff line change 3333 "prettier:fix:partial" : " prettier --write" ,
3434 "format" : " yarn lint && yarn prettier" ,
3535 "test" : " cross-env CORE_ENV=test jest" ,
36- "test:coverage" : " yarn test --coverage --coveragePathIgnorePatterns='/(index.ts)$'"
36+ "test:coverage" : " yarn test --coverage --coveragePathIgnorePatterns='/(index.ts)$'" ,
37+ "release" : " release-it"
3738 },
3839 "dependencies" : {
3940 "@uns/ark-crypto" : " ^5.6.0-dev" ,
6263 "lint-staged" : " ^10.0.7" ,
6364 "nock" : " ^12.0.0" ,
6465 "prettier" : " ^1.18.2" ,
66+ "release-it" : " ^14.6.1" ,
6567 "ts-jest" : " ^25.2.0" ,
6668 "ts-loader" : " ^6.0.4" ,
6769 "tslint" : " ^5.0.0" ,
Original file line number Diff line number Diff line change 22
33set -ex
44
5+ source ./set_npm_token.sh
6+
57# Check new commits since 24h
68if [ $( git log --since=" 1 day" | wc -l) -eq 0 ]; then
79 echo " Nothing to publish since 1 day." ;
@@ -21,17 +23,7 @@ DATE=$(date -u +%Y%m%d%H%M%S)
2123dev=" -dev.$DATE "
2224sed -i.bak ' /version/s/[^0-9]*$/' " $dev \" ,/" package.json
2325
24- if [[ -n " $CI " ]]; then
25- echo " Authenticate with registry."
26- if [[ -z " $NPM_TOKEN " ]]; then
27- echo " Error: NPM_TOKEN is not set."
28- exit 1
29- fi
30-
31- set +x
32- echo " //registry.npmjs.org/:_authToken=$NPM_TOKEN " > ~ /repo/.npmrc
33- set -x
34- fi
26+ set_npm_token
3527
3628echo " Publish package"
3729npm publish --tag=dev
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -ex
3+
4+ source ./set_npm_token.sh
5+
6+ COMMIT_MSG=$( git show-branch --no-name HEAD)
7+ COMMIT_MSG_REGEX=" ^Release ([0-9]+\.[0-9]+\.[0-9]+)$"
8+
9+ if [[ " $COMMIT_MSG " =~ $COMMIT_MSG_REGEX ]]; then
10+ VERSION=${BASH_REMATCH[1]}
11+ echo " Running automated release process for version $VERSION "
12+ set_npm_token
13+ yarn release --ci --config .release-it-ci.json
14+ else
15+ echo " Running nightly publish script"
16+ ./scripts/publish-nightly.sh
17+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set_npm_token () {
4+ if [[ -n " $CI " ]]; then
5+ echo " Authenticate with registry."
6+ if [[ -z " $NPM_TOKEN " ]]; then
7+ echo " Error: NPM_TOKEN env var is not set."
8+ exit 1
9+ fi
10+
11+ set +x
12+ echo " //registry.npmjs.org/:_authToken=$NPM_TOKEN " > ~ /repo/.npmrc
13+ set -x
14+ fi
15+ }
You can’t perform that action at this time.
0 commit comments