Skip to content

Commit 0a59e18

Browse files
committed
Update CI and pnpm
1 parent 37bce0a commit 0a59e18

File tree

4 files changed

+2080
-1735
lines changed

4 files changed

+2080
-1735
lines changed

.github/workflows/release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
permissions:
7+
contents: write
8+
jobs:
9+
release:
10+
name: Release On Tag
11+
if: startsWith(github.ref, 'refs/tags/')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the repository
15+
uses: actions/checkout@v4
16+
- name: Extract the changelog
17+
id: changelog
18+
run: |
19+
TAG_NAME=${GITHUB_REF/refs\/tags\//}
20+
READ_SECTION=false
21+
CHANGELOG=""
22+
while IFS= read -r line; do
23+
if [[ "$line" =~ ^#+\ +(.*) ]]; then
24+
if [[ "${BASH_REMATCH[1]}" == "$TAG_NAME" ]]; then
25+
READ_SECTION=true
26+
elif [[ "$READ_SECTION" == true ]]; then
27+
break
28+
fi
29+
elif [[ "$READ_SECTION" == true ]]; then
30+
CHANGELOG+="$line"$'\n'
31+
fi
32+
done < "CHANGELOG.md"
33+
CHANGELOG=$(echo "$CHANGELOG" | awk '/./ {$1=$1;print}')
34+
echo "changelog_content<<EOF" >> $GITHUB_OUTPUT
35+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
36+
echo "EOF" >> $GITHUB_OUTPUT
37+
- name: Create the release
38+
if: steps.changelog.outputs.changelog_content != ''
39+
uses: softprops/action-gh-release@v1
40+
with:
41+
name: ${{ github.ref_name }}
42+
body: '${{ steps.changelog.outputs.changelog_content }}'
43+
draft: false
44+
prerelease: false

.github/workflows/test.yml

+9-28
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,41 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout the repository
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
- name: Install pnpm
18-
uses: pnpm/action-setup@v2
18+
uses: pnpm/action-setup@v4
1919
with:
20-
version: 8
20+
version: 9
2121
- name: Install Node.js
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
24-
node-version: 20
24+
node-version: 22
2525
cache: pnpm
2626
- name: Install dependencies
27-
run: pnpm install --frozen-lockfile --ignore-scripts
27+
run: pnpm install --ignore-scripts
2828
- name: Run tests
2929
run: pnpm test
3030
short:
3131
runs-on: ubuntu-latest
3232
strategy:
3333
matrix:
3434
node-version:
35+
- 20
3536
- 18
36-
- 16
3737
name: Node.js ${{ matrix.node-version }} Quick
3838
steps:
3939
- name: Checkout the repository
4040
uses: actions/checkout@v3
4141
- name: Install pnpm
4242
uses: pnpm/action-setup@v2
4343
with:
44-
version: 8
44+
version: 9
4545
- name: Install Node.js ${{ matrix.node-version }}
4646
uses: actions/setup-node@v3
4747
with:
4848
node-version: ${{ matrix.node-version }}
4949
cache: pnpm
5050
- name: Install dependencies
51-
run: pnpm install --frozen-lockfile --ignore-scripts
52-
- name: Run unit tests
53-
run: pnpm unit
54-
old:
55-
runs-on: ubuntu-latest
56-
name: Node.js 14 Quick
57-
steps:
58-
- name: Checkout the repository
59-
uses: actions/checkout@v3
60-
- name: Install pnpm
61-
uses: pnpm/action-setup@v2
62-
with:
63-
version: 7
64-
- name: Install Node.js 14
65-
uses: actions/setup-node@v3
66-
with:
67-
node-version: 14
68-
cache: pnpm
69-
- name: Install dependencies
70-
run: pnpm install --no-frozen-lockfile --ignore-scripts
51+
run: pnpm install --ignore-scripts
7152
- name: Run unit tests
7253
run: pnpm unit

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"./package.json": "./package.json"
2929
},
3030
"engines": {
31-
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
31+
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
3232
},
3333
"peerDependencies": {
3434
"@logux/client": ">=0.10.0",

0 commit comments

Comments
 (0)