File tree 2 files changed +11
-5
lines changed
actions/cached-node-modules
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 4
4
nodeVersion : # id of input
5
5
description : ' Node.js version to use in the cache key'
6
6
default : ' 18'
7
+ build :
8
+ description : ' Whether to build the packages or not'
9
+ default : ' true'
7
10
outputs :
8
11
cache-hit :
9
12
description : " Whether the cache was hit or not"
28
31
run : npm ci
29
32
shell : bash
30
33
- name : Build packages
31
- # Regardless of whether the cache was hit or not, we need to build the packages.
32
- #
34
+ # Regardless of whether the cache was hit or not, we need to build the packages, unless the caller says otherwise
35
+ if : inputs.build == 'true'
33
36
# We build the shared package first, then the others in parallel to speed up the process
34
37
# even though we could just run `npm run build` in the root folder and build them in
35
38
# sequence, but still in the correct order.
Original file line number Diff line number Diff line change 28
28
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
29
29
- name : Setup dependencies
30
30
uses : ./.github/actions/cached-node-modules
31
+ with :
32
+ # We don't build the packages here as we want to version them first
33
+ build : false
31
34
- name : Version
32
35
run : |
33
36
# Version all packages to next major version (2.0.0) without pushing to git, generating changelog or running commit hooks
@@ -36,17 +39,17 @@ jobs:
36
39
- name : Set alpha iteration
37
40
run : |
38
41
# Get the current alpha version from npm i.e 2.0.0-alpha.0 -> 0, 2.0.0-alpha.1 -> 1 (default to -1 if no alpha versions exist = first pre-release)
39
- ITERATION=$(npm show @aws-lambda-powertools/commons time --json | jq -r 'to_entries | map(select(.key | startswith("2.0.0-alpha"))) | sort_by(.key) | last | .key // "-1"')
42
+ ITERATION=$(npm show @aws-lambda-powertools/commons time --json | jq -r 'to_entries | map(select(.key | startswith("2.0.0-alpha"))) | sort_by(.key) | last | .key // "-1"' | cut -d '.' -f 4 )
40
43
# Write the new version to the file
41
44
echo "{ \"iteration\": $((ITERATION + 1)) }" > v2.json
42
45
- name : Increment version in UA
43
46
run : |
44
47
# Increment the version in the UA
45
- echo "// this file is auto generated, do not modify\nexport const PT_VERSION = '2.0.0-alpha.$(jq -r '.iteration' v2.json)';" > packages/commons/src/version.ts
48
+ echo -e "// this file is auto generated, do not modify\nexport const PT_VERSION = '2.0.0-alpha.$(jq -r '.iteration' v2.json)';" > packages/commons/src/version.ts
46
49
- name : Build
47
50
run : |
51
+ npm run build -w packages/commons &
48
52
npm run build -w packages/batch \
49
- -w packages/commons \
50
53
-w packages/idempotency \
51
54
-w packages/logger \
52
55
-w packages/metrics \
You can’t perform that action at this time.
0 commit comments