File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,13 @@ npm run build:release
88
88
echo " Ran publish build."
89
89
90
90
echo " Making a $VERSION version..."
91
- # TODO: Remove the following command.
92
- # npm version command had previously failed claiming unclean git repo, and we don't know why.
93
- echo " DEBUG: Running git status to show dirty files... "
94
- git status
95
- npm version $VERSION
91
+ if [[ $PRE_RELEASE != " " ]] ; then
92
+ npm version pre $VERSION --preid=rc
93
+ else
94
+ npm version $VERSION
95
+ fi
96
96
NEW_VERSION=$( jq -r " .version" package.json)
97
- echo " Made a $VERSION version."
97
+ echo " Made a $NEW_VERSION version."
98
98
99
99
echo " Making the release notes..."
100
100
RELEASE_NOTES_FILE=$( mktemp)
@@ -105,14 +105,19 @@ cat CHANGELOG.md >> "${RELEASE_NOTES_FILE}"
105
105
echo " Made the release notes."
106
106
107
107
echo " Publishing to npm..."
108
- if [[ $DRY_RUN == " " ]]; then
109
- npm publish
110
- else
108
+ if [[ $DRY_RUN != " " ]]; then
111
109
echo " DRY RUN: running publish with --dry-run"
112
110
npm publish --dry-run
111
+ else
112
+ npm publish
113
113
fi
114
114
echo " Published to npm."
115
115
116
+ if [[ $PRE_RELEASE != " " ]]; then
117
+ echo " Published a pre-release version. Skipping post-release actions."
118
+ exit
119
+ fi
120
+
116
121
if [[ $DRY_RUN != " " ]]; then
117
122
echo " All other commands are mutations, and we are doing a dry run."
118
123
echo " Terminating."
Original file line number Diff line number Diff line change 99
99
- " REPOSITORY_ORG=${_REPOSITORY_ORG}"
100
100
- " REPOSITORY_NAME=${_REPOSITORY_NAME}"
101
101
- " DRY_RUN=${_DRY_RUN}"
102
+ - " PRE_RELEASE=${_PRE_RELEASE}"
102
103
103
104
options :
104
105
volumes :
@@ -107,6 +108,7 @@ options:
107
108
108
109
substitutions :
109
110
_VERSION : " "
111
+ _PRE_RELEASE : " "
110
112
_DRY_RUN : " "
111
113
_KEY_RING : " npm-publish-keyring"
112
114
_KEY_NAME : " publish"
You can’t perform that action at this time.
0 commit comments