11name : Make Version
22
33on :
4- workflow_dispatch : { }
4+ workflow_dispatch :
5+ inputs :
6+ release-type :
7+ description : ' Release type (major, minor, patch)'
8+ required : false
59
610permissions :
711 contents : read
@@ -14,39 +18,40 @@ jobs:
1418 contents : write
1519 pull-requests : write
1620 runs-on : ubuntu-latest
21+ env :
22+ NODE_VERSION : " 22"
1723 outputs :
18- RELEASE_VERSION : ${{ steps.set-release-version .outputs.RELEASE_VERSION }}
24+ RELEASE_VERSION : ${{ steps.version-n-changelog .outputs.new-version }}
1925 steps :
2026 - name : Checkout code
2127 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2228 with :
2329 ref : ${{ github.ref }}
24- fetch-depth : 0 # fetch all history, commits and tags, lerna scans it to the last tag and looks at commits, we need all of it to determine the next version
25- - name : Setup NodeJS
30+ fetch-depth : 0 # fetch all history, commits and tags, so we can determine the next version
31+ - name : Setup Node.js
2632 uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2733 with :
28- node-version : " 22 "
34+ node-version : ${{ env.NODE_VERSION }}
2935 cache : " npm"
3036 - name : Setup dependencies
31- uses : aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
32- - name : Version
33- id : bump-version
34- run : npx lerna version --conventional-commits --force-publish --no-git-tag-version --no-push --no-commit-hooks --yes
37+ uses : aws-powertools/actions/.github/actions/cached-node-modules@b8e12f37991bb03672113b65cae09d52d494bbef # v1.0.0
38+ with :
39+ node-version : ${{ env.NODE_VERSION }}
40+ - name : Version and changelog
41+ id : version-n-changelog
42+ uses : aws-powertools/actions/.github/actions/version-n-changelog@b8e12f37991bb03672113b65cae09d52d494bbef # v1.0.0
43+ with :
44+ release-type : ${{ github.event.inputs.release-type }}
3545 - name : Update user agent version
3646 run : |
37- VERSION=$(cat lerna.json | jq . version -r )
47+ VERSION=$(${{ steps.version-n-changelog.outputs.new- version }} )
3848 echo -e "// this file is auto generated, do not modify\nexport const PT_VERSION = '$VERSION';" > packages/commons/src/version.ts
3949 - name : Stage changes
4050 run : git add .
41- - name : Set release version
42- id : set-release-version
43- run : |
44- VERSION=$(cat lerna.json | jq .version -r)
45- echo RELEASE_VERSION="$VERSION" >> "$GITHUB_OUTPUT"
4651 - name : Create PR
4752 id : create-pr
4853 uses : ./.github/actions/create-pr
4954 with :
5055 temp_branch_prefix : " ci-bump"
51- pull_request_title : " chore(ci): bump version to ${{ steps.set-release-version .outputs.RELEASE_VERSION }}"
56+ pull_request_title : " chore(ci): bump version to ${{ steps.version-n-changelog .outputs.new-version }}"
5257 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments