Skip to content

Commit 83daebc

Browse files
committed
Upgrade Node.js version to 18.x and switch build process from yarn to pnpm
1 parent 58cdbe0 commit 83daebc

File tree

2 files changed

+70
-60
lines changed

2 files changed

+70
-60
lines changed

.github/workflows/build_new_lang.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
node-version: [16.x]
11+
node-version: [18.x]
1212
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1313

1414
steps:
@@ -19,13 +19,19 @@ jobs:
1919
node-version: ${{ matrix.node-version }}
2020
cache: "npm"
2121

22-
- run: yarn install
23-
- run: yarn build
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v2
24+
with:
25+
version: 9.12.2
26+
run_install: false
27+
28+
- run: pnpm install
29+
- run: pnpm build
2430
- run: |
2531
tar -zcvf linux-all-casaos-lang-build.tar.gz build
2632
2733
- name: Archive tarball
2834
uses: actions/upload-artifact@v4
2935
with:
3036
name: ui-package
31-
path: ./linux-all-casaos-lang-build.tar.gz
37+
path: ./linux-all-casaos-lang-build.tar.gz

.github/workflows/node-prerelease.js.yml

+60-56
Original file line numberDiff line numberDiff line change
@@ -12,68 +12,72 @@ on:
1212
# description: 'Tags'
1313
push:
1414
tags:
15-
- 'v*'
15+
- "v*"
1616
jobs:
1717
release:
18-
1918
runs-on: ubuntu-latest
2019
strategy:
2120
matrix:
22-
node-version: [ 16.x ]
21+
node-version: [18.x]
2322
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2423

2524
steps:
26-
- uses: actions/checkout@v3
27-
- name: '使用 Use Node.js ${{ matrix.node-version }}'
28-
uses: actions/setup-node@v3
29-
with:
30-
node-version: ${{ matrix.node-version }}
31-
cache: 'npm'
32-
- name: '缓存 Cache'
33-
uses: actions/cache@v3
34-
id: cache-dependencies
35-
with:
36-
path: node_modules
37-
key: ${{runner.OS}}-${{hashFiles('**/yarn.lock')}}
38-
- name: Fetch all tags
39-
run: sudo git fetch --force --tags
40-
- name: '读取当前版本号 Read the current version number'
41-
id: version
42-
uses: zhanghengxin/reading-a-file-of-JSON@ice
43-
with:
44-
path: ./package.json
45-
property:
46-
version
47-
- name: Get version
48-
id: get_version
49-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
50-
- name: '输出 echo artifact'
51-
run: |
52-
echo ${{ steps.version.outputs.value }}
53-
echo github ${{ github }}
54-
echo github.sha ${{ github.sha }}
55-
echo env.VERSION ${{ steps.get_version.outputs.VERSION }}
56-
- run: yarn install
57-
- run: yarn build
58-
- run: |
59-
tar -zcvf linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz build
60-
- name: '更新 Update release'
61-
uses: zhanghengxin/git-release-private@ice
62-
with:
63-
token: ${{ secrets.GITHUB_TOKEN }}
64-
allow_override: true
65-
gzip: false
66-
prerelease: true
67-
tag: ${{ steps.get_version.outputs.VERSION }}
68-
files: ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz
25+
- uses: actions/checkout@v3
26+
- name: "使用 Use Node.js ${{ matrix.node-version }}"
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: "npm"
31+
- name: "缓存 Cache"
32+
uses: actions/cache@v3
33+
id: cache-dependencies
34+
with:
35+
path: node_modules
36+
key: ${{runner.OS}}-${{hashFiles('**/yarn.lock')}}
37+
- name: Fetch all tags
38+
run: sudo git fetch --force --tags
39+
- name: "读取当前版本号 Read the current version number"
40+
id: version
41+
uses: zhanghengxin/reading-a-file-of-JSON@ice
42+
with:
43+
path: ./package.json
44+
property: version
45+
- name: Get version
46+
id: get_version
47+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
48+
- name: "输出 echo artifact"
49+
run: |
50+
echo ${{ steps.version.outputs.value }}
51+
echo github ${{ github }}
52+
echo github.sha ${{ github.sha }}
53+
echo env.VERSION ${{ steps.get_version.outputs.VERSION }}
54+
- name: Install pnpm
55+
uses: pnpm/action-setup@v2
56+
with:
57+
version: 9.12.2
58+
run_install: false
59+
60+
- run: pnpm install
61+
- run: pnpm build
62+
- run: |
63+
tar -zcvf linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz build
64+
- name: "更新 Update release"
65+
uses: zhanghengxin/git-release-private@ice
66+
with:
67+
token: ${{ secrets.GITHUB_TOKEN }}
68+
allow_override: true
69+
gzip: false
70+
prerelease: true
71+
tag: ${{ steps.get_version.outputs.VERSION }}
72+
files: ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz
6973

70-
- name: Upload to oss
71-
id: upload_to_oss
72-
uses: tvrcgo/upload-to-oss@master
73-
with:
74-
key-id: ${{ secrets.OSS_KEY_ID }}
75-
key-secret: ${{ secrets.OSS_KEY_SECRET }}
76-
region: oss-cn-shanghai
77-
bucket: casaos
78-
assets: |
79-
./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UI/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz
74+
- name: Upload to oss
75+
id: upload_to_oss
76+
uses: tvrcgo/upload-to-oss@master
77+
with:
78+
key-id: ${{ secrets.OSS_KEY_ID }}
79+
key-secret: ${{ secrets.OSS_KEY_SECRET }}
80+
region: oss-cn-shanghai
81+
bucket: casaos
82+
assets: |
83+
./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UI/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz

0 commit comments

Comments
 (0)