Skip to content

Commit 99200f1

Browse files
authored
Release Pipeline (#56)
1 parent e9616c9 commit 99200f1

13 files changed

Lines changed: 105 additions & 10 deletions

.npmignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,10 @@ deps_build/
164164
**/builder.json
165165
**/.travis*
166166
**/.github/
167-
**/codebuild/
167+
**/continuous-delivery/
168168
**/docs/
169169

170170
# Skip large submodule files
171171
aws-common-runtime/*/tests/
172-
aws-common-runtime/aws-c-common/.cbmc-batch/
172+
aws-common-runtime/*/.cbmc-batch/
173+
aws-common-runtime/*/codebuild/

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
Node.js bindings for the AWS Common Runtime.
44

5-
> Note that this module currently only supports Linux and macOS.
6-
75
## License
86

97
This library is licensed under the Apache 2.0 License.
@@ -13,10 +11,14 @@ This library is licensed under the Apache 2.0 License.
1311
### Dependencies
1412

1513
Requirements:
14+
* Node.js 10.16 or newer
15+
16+
### Build Dependencies
17+
18+
If you'd like to run a custom build, you'll need the following:
1619
* Clang 3.9+ or GCC 4.4+
1720
* libssl-dev (on Linux/Unix POSIX platforms)
1821
* cmake 3.1+
19-
* Node.js 10.x or newer
2022

2123
#### Linux/Unix
2224
```bash
@@ -37,4 +39,6 @@ $ export AWS_C_INSTALL=/path/to/install/root/
3739
$ git submodule update --init
3840
# Build the package
3941
$ npm install
42+
# Rebuild with your changes
43+
$ node ./scripts/build.js
4044
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
runtime-versions:
5+
nodejs: 10
6+
commands:
7+
- apt-get install -y cmake
8+
build:
9+
commands:
10+
- mkdir linux-x64
11+
- cd aws-crt-nodejs
12+
- bash ./continuous-delivery/build-binaries-unix.sh
13+
- cp -r dist/bin/linux-x64/* ../linux-x64
14+
15+
artifacts:
16+
files:
17+
- 'linux-x64/**/*'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
npm install --unsafe-perm
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
npm install || goto error
2+
3+
:error
4+
echo Failed with error #%errorlevel%.
5+
exit /b %errorlevel%

continuous-delivery/pack.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
runtime-versions:
5+
nodejs: 10
6+
build:
7+
commands:
8+
- cd aws-crt-nodejs
9+
- export DIST_BIN=dist/bin
10+
- mkdir -p $DIST_BIN
11+
- cp -r $CODEBUILD_SRC_DIR_aws_crt_nodejs_linux_x64/* $DIST_BIN
12+
- cp -r $CODEBUILD_SRC_DIR_aws_crt_nodejs_osx_x64/* $DIST_BIN
13+
- cp -r $CODEBUILD_SRC_DIR_aws_crt_nodejs_win_x64/* $DIST_BIN
14+
- ls $DIST_BIN
15+
- npm install --unsafe-perm
16+
- npm pack --unsafe-perm
17+
- cp aws-crt-*.tgz ..
18+
19+
artifacts:
20+
files:
21+
- 'aws-crt-*.tgz'

continuous-delivery/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
runtime-versions:
5+
nodejs: 10
6+
build:
7+
commands:
8+
- cd $CODEBUILD_SRC_DIR_aws_crt_nodejs_packed
9+
- aws secretsmanager get-secret-value --secret-id prod/npm-registry/.npmrc --region us-east-1 | jq -r .SecretString > .npmrc
10+
- npm --userconfig ./.npmrc publish aws-crt-*.tgz
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
set -x
4+
5+
# force a failure if there's no tag
6+
git describe --tags
7+
# now get the tag
8+
CURRENT_TAG=$(git describe --tags | cut -f2 -dv)
9+
# convert v0.2.12-2-g50254a9 to 0.2.12
10+
CURRENT_TAG_VERSION=$(git describe --tags | cut -f1 -d'-' | cut -f2 -dv)
11+
# if there's a hash on the tag, then this is not a release tagged commit
12+
if [ "$CURRENT_TAG" != "$CURRENT_TAG_VERSION" ]; then
13+
echo "Current tag version is not a release tag, cut a new release if you want to publish."
14+
exit 1
15+
fi
16+
17+
PUBLISHED_TAG_VERSION=`npm show aws-crt version`
18+
if [ "$PUBLISHED_TAG_VERSION" == "$CURRENT_TAG_VERSION" ]; then
19+
echo "$CURRENT_TAG_VERSION is already in npm, cut a new tag if you want to upload another version."
20+
exit 1
21+
fi
22+
23+
echo "$CURRENT_TAG_VERSION currently does not exist in npm, allowing pipeline to continue."
24+
exit 0
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
runtime-versions:
5+
nodejs: 10
6+
build:
7+
commands:
8+
- cd aws-crt-nodejs
9+
- bash ./continuous-delivery/test-version-exists.sh

0 commit comments

Comments
 (0)