Skip to content

Commit 65e6c5a

Browse files
authored
ci: remove lerna version (#4201)
1 parent 296d6dd commit 65e6c5a

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

.github/workflows/make-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Set release version
7070
id: set-release-version
7171
run: |
72-
VERSION=$(cat lerna.json | jq .version -r)
72+
VERSION=$(cat packages/commons/package.json | jq .version -r)
7373
echo RELEASE_VERSION="$VERSION" >> "$GITHUB_OUTPUT"
7474
7575
# This job creates a new git tag using the released version (v1.18.1)

.github/workflows/make-version.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Make Version
22

33
on:
4-
workflow_dispatch: { }
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
description: 'Release type (major, minor, patch)'
8+
required: false
59

610
permissions:
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

Comments
 (0)