From 04a890870cf68811bd549605b3758ad46d3e6083 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Mon, 9 Dec 2024 16:41:07 +0800 Subject: [PATCH] update --- .github/workflows/release.yml | 48 ++++++++++++++++++++++++--------- ci/prepare_build_environment.sh | 9 ------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bbe12013463..435838377b96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,13 +96,17 @@ jobs: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - - name: Prepare build environment for macOS & Linux - run: bash ./ci/prepare_build_environment.sh - if: runner.os != 'Windows' + - name: Run on node 16 + run: | + sed -i -e 's/mirrorlist/#mirrorlist/g' -e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + yum -y install curl - - name: Prepare build environment for Windows - run: ./ci/prepare_build_environment.ps1 - if: runner.os == 'Windows' + touch "$HOME/.bashrc" + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" + nvm install 16 + if: runner.os == 'Linux' - name: Checkout uses: actions/checkout@v3 @@ -135,6 +139,14 @@ jobs: ~/.cargo/registry ~/.cargo/git + - name: Prepare build environment for macOS & Linux + run: bash ./ci/prepare_build_environment.sh + if: runner.os != 'Windows' + + - name: Prepare build environment for Windows + run: ./ci/prepare_build_environment.ps1 + if: runner.os == 'Windows' + - name: Install CUDA toolkit for Windows uses: Jimver/cuda-toolkit@v0.2.11 with: @@ -195,13 +207,17 @@ jobs: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - - name: Prepare build environment for macOS & Linux - run: bash ./ci/prepare_build_environment.sh - if: runner.os != 'Windows' + - name: Run on node 16 + run: | + sed -i -e 's/mirrorlist/#mirrorlist/g' -e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + yum -y install curl - - name: Prepare build environment for Windows - run: ./ci/prepare_build_environment.ps1 - if: runner.os == 'Windows' + touch "$HOME/.bashrc" + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" + nvm install 16 + if: runner.os == 'Linux' - name: Checkout uses: actions/checkout@v3 @@ -234,6 +250,14 @@ jobs: ~/.cargo/registry ~/.cargo/git + - name: Prepare build environment for macOS & Linux + run: bash ./ci/prepare_build_environment.sh + if: runner.os != 'Windows' + + - name: Prepare build environment for Windows + run: ./ci/prepare_build_environment.ps1 + if: runner.os == 'Windows' + - name: Build release binary run: cargo build ${{ matrix.build_args }} --release --target ${{ matrix.target }} --package tabby diff --git a/ci/prepare_build_environment.sh b/ci/prepare_build_environment.sh index c8e884071f68..7ee6b585fd1f 100755 --- a/ci/prepare_build_environment.sh +++ b/ci/prepare_build_environment.sh @@ -11,14 +11,6 @@ install_mailpit() { bash < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh) } -install_node16() { - touch "$HOME/.bashrc" - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" - nvm install 16 -} - if [[ "$OSTYPE" == "darwin"* ]]; then brew install protobuf install_mailpit @@ -38,7 +30,6 @@ if [[ "$OSTYPE" == "linux"* ]]; then git config --system --add safe.directory "*" install_protobuf_centos - install_node16 fi install_mailpit