diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83846aca2e53..0bbe12013463 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,16 +96,13 @@ 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: | - apt update && apt -y install wget - touch "$HOME/.bashrc" - wget -qO- 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: Prepare build environment for Windows + run: ./ci/prepare_build_environment.ps1 + if: runner.os == 'Windows' - name: Checkout uses: actions/checkout@v3 @@ -138,14 +135,6 @@ 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: @@ -206,6 +195,14 @@ 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: Prepare build environment for Windows + run: ./ci/prepare_build_environment.ps1 + if: runner.os == 'Windows' + - name: Checkout uses: actions/checkout@v3 with: @@ -237,14 +234,6 @@ 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 7ee6b585fd1f..c8e884071f68 100755 --- a/ci/prepare_build_environment.sh +++ b/ci/prepare_build_environment.sh @@ -11,6 +11,14 @@ 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 @@ -30,6 +38,7 @@ if [[ "$OSTYPE" == "linux"* ]]; then git config --system --add safe.directory "*" install_protobuf_centos + install_node16 fi install_mailpit