Skip to content

Commit

Permalink
Upgrade Node.js version to 18.x and switch build process from yarn to…
Browse files Browse the repository at this point in the history
… pnpm
  • Loading branch information
jerrykuku committed Dec 8, 2024
1 parent 58cdbe0 commit 83daebc
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 60 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build_new_lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -19,13 +19,19 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "npm"

- run: yarn install
- run: yarn build
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.12.2
run_install: false

- run: pnpm install
- run: pnpm build
- run: |
tar -zcvf linux-all-casaos-lang-build.tar.gz build
- name: Archive tarball
uses: actions/upload-artifact@v4
with:
name: ui-package
path: ./linux-all-casaos-lang-build.tar.gz
path: ./linux-all-casaos-lang-build.tar.gz
116 changes: 60 additions & 56 deletions .github/workflows/node-prerelease.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,72 @@ on:
# description: 'Tags'
push:
tags:
- 'v*'
- "v*"
jobs:
release:

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: '使用 Use Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: '缓存 Cache'
uses: actions/cache@v3
id: cache-dependencies
with:
path: node_modules
key: ${{runner.OS}}-${{hashFiles('**/yarn.lock')}}
- name: Fetch all tags
run: sudo git fetch --force --tags
- name: '读取当前版本号 Read the current version number'
id: version
uses: zhanghengxin/reading-a-file-of-JSON@ice
with:
path: ./package.json
property:
version
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: '输出 echo artifact'
run: |
echo ${{ steps.version.outputs.value }}
echo github ${{ github }}
echo github.sha ${{ github.sha }}
echo env.VERSION ${{ steps.get_version.outputs.VERSION }}
- run: yarn install
- run: yarn build
- run: |
tar -zcvf linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz build
- name: '更新 Update release'
uses: zhanghengxin/git-release-private@ice
with:
token: ${{ secrets.GITHUB_TOKEN }}
allow_override: true
gzip: false
prerelease: true
tag: ${{ steps.get_version.outputs.VERSION }}
files: ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz
- uses: actions/checkout@v3
- name: "使用 Use Node.js ${{ matrix.node-version }}"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: "缓存 Cache"
uses: actions/cache@v3
id: cache-dependencies
with:
path: node_modules
key: ${{runner.OS}}-${{hashFiles('**/yarn.lock')}}
- name: Fetch all tags
run: sudo git fetch --force --tags
- name: "读取当前版本号 Read the current version number"
id: version
uses: zhanghengxin/reading-a-file-of-JSON@ice
with:
path: ./package.json
property: version
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: "输出 echo artifact"
run: |
echo ${{ steps.version.outputs.value }}
echo github ${{ github }}
echo github.sha ${{ github.sha }}
echo env.VERSION ${{ steps.get_version.outputs.VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.12.2
run_install: false

- run: pnpm install
- run: pnpm build
- run: |
tar -zcvf linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz build
- name: "更新 Update release"
uses: zhanghengxin/git-release-private@ice
with:
token: ${{ secrets.GITHUB_TOKEN }}
allow_override: true
gzip: false
prerelease: true
tag: ${{ steps.get_version.outputs.VERSION }}
files: ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz

- name: Upload to oss
id: upload_to_oss
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: oss-cn-shanghai
bucket: casaos
assets: |
./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
- name: Upload to oss
id: upload_to_oss
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: oss-cn-shanghai
bucket: casaos
assets: |
./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 comments on commit 83daebc

Please sign in to comment.