1
1
name : Make Version
2
2
3
3
on :
4
- workflow_dispatch : { }
4
+ workflow_dispatch :
5
+ inputs :
6
+ release-type :
7
+ description : ' Release type (major, minor, patch)'
8
+ required : false
5
9
6
10
permissions :
7
11
contents : read
@@ -14,39 +18,40 @@ jobs:
14
18
contents : write
15
19
pull-requests : write
16
20
runs-on : ubuntu-latest
21
+ env :
22
+ NODE_VERSION : " 22"
17
23
outputs :
18
- RELEASE_VERSION : ${{ steps.set-release-version .outputs.RELEASE_VERSION }}
24
+ RELEASE_VERSION : ${{ steps.version-n-changelog .outputs.new-version }}
19
25
steps :
20
26
- name : Checkout code
21
27
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22
28
with :
23
29
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
26
32
uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
27
33
with :
28
- node-version : " 22 "
34
+ node-version : ${{ env.NODE_VERSION }}
29
35
cache : " npm"
30
36
- 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 }}
35
45
- name : Update user agent version
36
46
run : |
37
- VERSION=$(cat lerna.json | jq . version -r )
47
+ VERSION=$(${{ steps.version-n-changelog.outputs.new- version }} )
38
48
echo -e "// this file is auto generated, do not modify\nexport const PT_VERSION = '$VERSION';" > packages/commons/src/version.ts
39
49
- name : Stage changes
40
50
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"
46
51
- name : Create PR
47
52
id : create-pr
48
53
uses : ./.github/actions/create-pr
49
54
with :
50
55
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 }}"
52
57
github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments