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 32
32
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
33
33
- name : Setup dependencies
34
34
uses : ./.github/actions/cached-node-modules
35
+ with :
36
+ # We don't build the packages here as we want to version them first
37
+ build : false
35
38
- name : Version
36
39
run : |
37
40
# Version all packages to next major version (2.0.0) without pushing to git, generating changelog or running commit hooks
@@ -40,17 +43,17 @@ jobs:
40
43
- name : Set alpha iteration
41
44
run : |
42
45
# 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)
43
- 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"')
46
+ 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 )
44
47
# Write the new version to the file
45
48
echo "{ \"iteration\": $((ITERATION + 1)) }" > v2.json
46
49
- name : Increment version in UA
47
50
run : |
48
51
# Increment the version in the UA
49
- 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
52
+ 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
50
53
- name : Build
51
54
run : |
55
+ npm run build -w packages/commons &
52
56
npm run build -w packages/batch \
53
- -w packages/commons \
54
57
-w packages/idempotency \
55
58
-w packages/logger \
56
59
-w packages/metrics \
You can’t perform that action at this time.
0 commit comments