File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
actions/cached-node-modules Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 44 nodeVersion : # id of input
55 description : ' Node.js version to use in the cache key'
66 default : ' 20'
7+ build :
8+ description : ' Whether to build the packages or not'
9+ default : ' true'
710outputs :
811 cache-hit :
912 description : " Whether the cache was hit or not"
2932 run : npm ci
3033 shell : bash
3134 - 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'
3437 # We build the shared package first, then the others in parallel to speed up the process
3538 # even though we could just run `npm run build` in the root folder and build them in
3639 # sequence, but still in the correct order.
Original file line number Diff line number Diff line change 3232 npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
3333 - name : Setup dependencies
3434 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
3538 - name : Version
3639 run : |
3740 # 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:
4043 - name : Set alpha iteration
4144 run : |
4245 # 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 )
4447 # Write the new version to the file
4548 echo "{ \"iteration\": $((ITERATION + 1)) }" > v2.json
4649 - name : Increment version in UA
4750 run : |
4851 # 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
5053 - name : Build
5154 run : |
55+ npm run build -w packages/commons &
5256 npm run build -w packages/batch \
53- -w packages/commons \
5457 -w packages/idempotency \
5558 -w packages/logger \
5659 -w packages/metrics \
You can’t perform that action at this time.
0 commit comments