Skip to content

Commit a1357c7

Browse files
committed
ci: update workflows and set node version to v22
1 parent a126928 commit a1357c7

File tree

4 files changed

+38
-19
lines changed

4 files changed

+38
-19
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Set Up Node.js'
2+
description: 'Set up Node.js using the version specified in .nvmrc'
3+
4+
outputs:
5+
node-version:
6+
description: 'The Node.js version that was set up'
7+
value: ${{ steps.nvm.outputs.NVMRC }}
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Read .nvmrc
13+
id: nvm
14+
shell: bash
15+
run: |
16+
if [[ -f .nvmrc && -s .nvmrc ]]; then
17+
read -r NVMRC_CONTENT < .nvmrc
18+
else
19+
echo "⚠️ .nvmrc file missing or empty, defaulting to LTS"
20+
NVMRC_CONTENT="lts/*"
21+
fi
22+
printf 'NVMRC=%s\n' "$NVMRC_CONTENT" >> $GITHUB_OUTPUT
23+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
24+
with:
25+
node-version: "${{ steps.nvm.outputs.NVMRC }}"
26+
cache: 'npm'
27+
- name: Verify Node.js setup
28+
shell: bash
29+
run: echo "✅ Node $(node -v), npm $(npm -v)"

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
- name: Read .nvmrc
16-
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
17-
id: nvm
18-
- uses: actions/setup-node@v3
19-
with:
20-
node-version: "${{ steps.nvm.outputs.NVMRC }}"
21-
- run: node -v && npm -v
22-
- run: npm ci
15+
- uses: ./.github/actions/set-up-node
2316
- run: npm run lint
2417

2518
commitlint:

.github/workflows/release.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,27 @@ jobs:
1616
outputs:
1717
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
1818
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
19+
last_release_git_tag: ${{ steps.semantic.outputs.last_release_git_tag }}
20+
last_release_version: ${{ steps.semantic.outputs.last_release_version }}
1921
steps:
20-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2123
with:
2224
persist-credentials: false
23-
- name: Read .nvmrc
24-
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
25-
id: nvm
26-
- uses: actions/setup-node@v3
27-
with:
28-
node-version: "${{ steps.nvm.outputs.NVMRC }}"
29-
- run: node -v && npm -v
25+
- uses: ./.github/actions/set-up-node
3026
- run: npm ci
3127
- name: Semantic Release
32-
uses: cycjimmy/semantic-release-action@v3
28+
uses: cycjimmy/semantic-release-action@c4a2fa890676fc2db25ad0aacd8ab4a0f1f4c024 # v4.2.1
3329
id: semantic # Need an `id` for output variables
3430
with:
3531
semantic_version: 19.0.5
3632
extra_plugins: |
3733
@semantic-release/changelog@6.0.2
34+
@semantic-release/exec@6.0.3
3835
@semantic-release/git@10.0.1
3936
conventional-changelog-conventionalcommits@5.0.0
4037
env:
4138
GITHUB_TOKEN: ${{ secrets.CREATE_RELEASE }}
4239
GH_USERNAME: lime-opensource
4340
GH_TOKEN: ${{ secrets.CREATE_RELEASE }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ads }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4542
CI: true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/*
1+
v22

0 commit comments

Comments
 (0)