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 : ' 20'
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"
29
32
run : npm ci
30
33
shell : bash
31
34
- name : Build packages
32
- # Regardless of whether the cache was hit or not, we need to build the packages.
33
- #
35
+ # Regardless of whether the cache was hit or not, we need to build the packages, unless the caller says otherwise
36
+ if : inputs.build == 'true'
34
37
# We build the shared package first, then the others in parallel to speed up the process
35
38
# even though we could just run `npm run build` in the root folder and build them in
36
39
# sequence, but still in the correct order.
Original file line number Diff line number Diff line change 33
33
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
34
34
- name : Setup dependencies
35
35
uses : ./.github/actions/cached-node-modules
36
+ with :
37
+ # We don't build the packages here as we want to version them first
38
+ build : false
36
39
- name : Version
37
40
run : |
38
41
# Version all packages to next major version (2.0.0) without pushing to git, generating changelog or running commit hooks
@@ -41,17 +44,17 @@ jobs:
41
44
- name : Set alpha iteration
42
45
run : |
43
46
# 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)
44
- 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"')
47
+ 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 )
45
48
# Write the new version to the file
46
49
echo "{ \"iteration\": $((ITERATION + 1)) }" > v2.json
47
50
- name : Increment version in UA
48
51
run : |
49
52
# Increment the version in the UA
50
- 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
53
+ 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
51
54
- name : Build
52
55
run : |
56
+ npm run build -w packages/commons &
53
57
npm run build -w packages/batch \
54
- -w packages/commons \
55
58
-w packages/idempotency \
56
59
-w packages/logger \
57
60
-w packages/metrics \
You can’t perform that action at this time.
0 commit comments