From 8f35f6c0261ada6fb1e4fb833cbeab3d6fff9bc4 Mon Sep 17 00:00:00 2001 From: wuzhiqing Date: Thu, 19 Sep 2024 11:55:21 +0000 Subject: [PATCH] chore: Use pnpm in CI/CD --- .github/workflows/app.yml | 4 ++-- .gitpod.yml | 4 ++-- scripts/setup.sh | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 7e74cf04595a..c6c26e3ccc60 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -57,7 +57,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - cache: 'yarn' + cache: 'pnpm' - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: @@ -71,7 +71,7 @@ jobs: sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf - name: install frontend dependencies - run: yarn install # change this to npm or pnpm depending on which one you use + run: pnpm install # change this to npm or pnpm depending on which one you use - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitpod.yml b/.gitpod.yml index d81f2dab15cc..2563fd3e30ac 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -5,7 +5,7 @@ # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart tasks: - - init: yarn install && yarn run dev - command: yarn run dev + - init: pnpm install && pnpm dev + command: pnpm dev diff --git a/scripts/setup.sh b/scripts/setup.sh index 50488f963bc3..7ecb6372255d 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -26,21 +26,21 @@ case "$(uname -s)" in esac # Check if needed dependencies are installed and install if necessary -if ! command -v node >/dev/null || ! command -v git >/dev/null || ! command -v yarn >/dev/null; then +if ! command -v node >/dev/null || ! command -v git >/dev/null || ! command -v pnpm >/dev/null; then case "$(uname -s)" in Linux) if [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=ubuntu" ]]; then sudo apt-get update - sudo apt-get -y install nodejs git yarn + sudo apt-get -y install nodejs git pnpm elif [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=debian" ]]; then sudo apt-get update - sudo apt-get -y install nodejs git yarn + sudo apt-get -y install nodejs git pnpm elif [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=centos" ]]; then sudo yum -y install epel-release - sudo yum -y install nodejs git yarn + sudo yum -y install nodejs git pnpm elif [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=arch" ]]; then sudo pacman -Syu -y - sudo pacman -S -y nodejs git yarn + sudo pacman -S -y nodejs git pnpm else echo "Unsupported Linux distribution" exit 1 @@ -48,7 +48,7 @@ if ! command -v node >/dev/null || ! command -v git >/dev/null || ! command -v y ;; Darwin) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - brew install node git yarn + brew install node git pnpm ;; esac fi @@ -56,7 +56,7 @@ fi # Clone the repository and install dependencies git clone https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web cd ChatGPT-Next-Web -yarn install +pnpm install # Prompt user for environment variables read -p "Enter OPENAI_API_KEY: " OPENAI_API_KEY @@ -64,5 +64,5 @@ read -p "Enter CODE: " CODE read -p "Enter PORT: " PORT # Build and run the project using the environment variables -OPENAI_API_KEY=$OPENAI_API_KEY CODE=$CODE PORT=$PORT yarn build -OPENAI_API_KEY=$OPENAI_API_KEY CODE=$CODE PORT=$PORT yarn start +OPENAI_API_KEY=$OPENAI_API_KEY CODE=$CODE PORT=$PORT pnpm build +OPENAI_API_KEY=$OPENAI_API_KEY CODE=$CODE PORT=$PORT pnpm start