chore: Use pnpm in CI/CD

This commit is contained in:
wuzhiqing 2024-09-19 11:55:21 +00:00 committed by DDDDD12138
parent 3069b5cfc3
commit 567e58f69b
3 changed files with 13 additions and 13 deletions

View File

@ -57,7 +57,7 @@ jobs:
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
cache: 'yarn' cache: 'pnpm'
- name: install Rust stable - name: install Rust stable
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
@ -71,7 +71,7 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies - 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 - uses: tauri-apps/tauri-action@v0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -5,7 +5,7 @@
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
tasks: tasks:
- init: yarn install && yarn run dev - init: pnpm install && pnpm dev
command: yarn run dev command: pnpm dev

View File

@ -26,21 +26,21 @@ case "$(uname -s)" in
esac esac
# Check if needed dependencies are installed and install if necessary # 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 case "$(uname -s)" in
Linux) Linux)
if [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=ubuntu" ]]; then if [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=ubuntu" ]]; then
sudo apt-get update 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 elif [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=debian" ]]; then
sudo apt-get update 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 elif [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=centos" ]]; then
sudo yum -y install epel-release 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 elif [[ "$(cat /etc/*-release | grep '^ID=')" = "ID=arch" ]]; then
sudo pacman -Syu -y sudo pacman -Syu -y
sudo pacman -S -y nodejs git yarn sudo pacman -S -y nodejs git pnpm
else else
echo "Unsupported Linux distribution" echo "Unsupported Linux distribution"
exit 1 exit 1
@ -48,7 +48,7 @@ if ! command -v node >/dev/null || ! command -v git >/dev/null || ! command -v y
;; ;;
Darwin) Darwin)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /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 esac
fi fi
@ -56,7 +56,7 @@ fi
# Clone the repository and install dependencies # Clone the repository and install dependencies
git clone https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web git clone https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
cd ChatGPT-Next-Web cd ChatGPT-Next-Web
yarn install pnpm install
# Prompt user for environment variables # Prompt user for environment variables
read -p "Enter OPENAI_API_KEY: " OPENAI_API_KEY read -p "Enter OPENAI_API_KEY: " OPENAI_API_KEY
@ -64,5 +64,5 @@ read -p "Enter CODE: " CODE
read -p "Enter PORT: " PORT read -p "Enter PORT: " PORT
# Build and run the project using the environment variables # 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 pnpm build
OPENAI_API_KEY=$OPENAI_API_KEY CODE=$CODE PORT=$PORT yarn start OPENAI_API_KEY=$OPENAI_API_KEY CODE=$CODE PORT=$PORT pnpm start