ci: revise workflows to use .nvmrc (node 18) (#1290)

This commit is contained in:
hehe 2023-03-04 14:07:09 +08:00 committed by GitHub
parent b6480bf8a6
commit 693e7b204b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 80 deletions

View File

@ -25,11 +25,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
scope: '@toeverything'
cache: 'pnpm'
@ -47,8 +45,7 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- run: pnpm i --no-frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_AUTH_TOKEN }}

View File

@ -24,11 +24,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Restore cache
@ -43,7 +41,7 @@ jobs:
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Build
run: pnpm install && pnpm build
run: pnpm i && pnpm build
env:
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
@ -72,14 +70,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm i
- name: Download artifact
uses: actions/download-artifact@v3
@ -131,11 +126,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
scope: '@toeverything'
cache: 'pnpm'
@ -153,8 +146,7 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- run: pnpm i --no-frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_AUTH_TOKEN }}

View File

@ -22,17 +22,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
scope: '@toeverything'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: pnpm i --no-frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_AUTH_TOKEN }}

View File

@ -62,23 +62,19 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
submodules: 'true'
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm i
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
@ -89,9 +85,6 @@ jobs:
workspaces: |
apps/desktop/src-tauri
- name: Install dependencies
run: pnpm i -r
- name: Make App Binary
run: pnpm build:app
working-directory: apps/desktop

View File

@ -23,28 +23,15 @@ concurrency:
jobs:
main:
strategy:
matrix:
node-version: [18]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }}
# https://github.com/actions/setup-node
uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install node modules
run: pnpm install
- run: pnpm i
- name: Check Language Key
if: github.ref != 'refs/heads/master'

View File

@ -21,11 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Restore cache
@ -39,8 +37,7 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: pnpm install
- run: pnpm i
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_AUTH_TOKEN }}

View File

@ -19,21 +19,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js 18
# https://github.com/actions/setup-node
uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: '18.X'
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- run: pnpm i
- name: Get old version
id: old-version

2
.nvmrc
View File

@ -1 +1 @@
16
18

View File

@ -229,6 +229,6 @@ See [LICENSE] for details.
[rust-version-icon]: https://img.shields.io/badge/Rust-1.67-dea584
[stars-icon]: https://img.shields.io/github/stars/toeverything/AFFiNE.svg?style=flat&logo=github&colorB=red&label=stars
[codecov]: https://codecov.io/gh/toeverything/affine/branch/master/graphs/badge.svg?branch=master
[node-version-icon]: https://img.shields.io/badge/node->=16.0-success
[node-version-icon]: https://img.shields.io/badge/node->=18.0-success
[typescript-version-icon]: https://img.shields.io/badge/TypeScript-4.9-3178c6
[react-version-icon]: https://img.shields.io/badge/React-18-61dafb