File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ phases:
10
10
commands :
11
11
- cd $CODEBUILD_SRC_DIR/aws-iot-device-sdk-js-v2
12
12
- aws secretsmanager get-secret-value --secret-id prod/npm-registry/.npmrc --region us-east-1 | jq -r .SecretString > .npmrc
13
- - sed --in-place -E "s/\"version\": : \".+\"/\" version\":: \"${PKG_VERSION}\"/" package.json
13
+ - ./update- version.sh
14
14
- npm install
15
15
- npm pack
16
16
- npm --userconfig ./.npmrc publish aws-iot-device-sdk-v2*.tgz
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -ex
3
+
4
+ # force a failure if there's no tag
5
+ git describe --tags
6
+ # now get the tag
7
+ CURRENT_TAG=$( git describe --tags | cut -f2 -dv)
8
+ # convert v0.2.12-2-g50254a9 to 0.2.12
9
+ CURRENT_TAG_VERSION=$( git describe --tags | cut -f1 -d' -' | cut -f2 -dv)
10
+ # if there's a hash on the tag, then this is not a release tagged commit
11
+ if [ " $CURRENT_TAG " != " $CURRENT_TAG_VERSION " ]; then
12
+ echo " Current tag version is not a release tag, cut a new release if you want to publish."
13
+ exit 1
14
+ fi
15
+
16
+ sed --in-place -E " s/\" version\" : \" .+\" /\" version\" : \" ${PKG_VERSION} \" /" package.json
17
+
18
+ exit 0
You can’t perform that action at this time.
0 commit comments