Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Dec 9, 2024
1 parent ce47bef commit e8af527
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
39 changes: 14 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
with:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions ci/prepare_build_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,6 +38,7 @@ if [[ "$OSTYPE" == "linux"* ]]; then
git config --system --add safe.directory "*"

install_protobuf_centos
install_node16
fi

install_mailpit
Expand Down

0 comments on commit e8af527

Please sign in to comment.