Skip to content

Commit

Permalink
ci: move build commands to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed May 5, 2024
1 parent 05bfa62 commit d0b9083
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 27 deletions.
36 changes: 9 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,25 @@ jobs:
with:
path: externals
key: ${{ runner.os }}-externals
- name: Prepare Toolchain (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Prepare Vulkan SDK
if: runner.os == 'Linux'
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Install dependencies
run: yarn install
- name: Build (Linux)
if: runner.os == 'Linux'
run: |
yarn clean && yarn build-native -a x86_64 --CDLLAMA_VULKAN=1
yarn clean && yarn build-native -a aarch64 --cc aarch64-linux-gnu-gcc --cxx aarch64-linux-gnu-g++
- name: Prepare SDK (Windows)
- name: Prepare (Windows)
if: runner.os == 'Windows'
shell: bash
run: bash ./scripts/prepare-windows.sh
- name: Build (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
yarn clean && yarn build-native -a x86_64
yarn clean && yarn build-native -a arm64
X64_SDK_ROOT=$(python -c "import os,sys; print(os.path.abspath(sys.argv[1]))" "externals/win32-x64/SDK")
ARM64_SDK_ROOT=$(python -c "import os,sys; print(os.path.abspath(sys.argv[1]))" "externals/win32-arm64/SDK")
yarn clean && yarn build-native -a x86_64 --CDVARIANT=opencl --CDLLAMA_CLBLAST=ON --CDCMAKE_PREFIX_PATH=$X64_SDK_ROOT/lib/cmake/CLBlast
yarn clean && yarn build-native -a arm64 --CDVARIANT=opencl --CDLLAMA_CLBLAST=ON --CDCMAKE_PREFIX_PATH=$ARM64_SDK_ROOT/lib/cmake/CLBlast
run: bash ./scripts/build-windows.sh
- name: Prepare (Linux)
if: runner.os == 'Linux'
run: bash ./scripts/prepare-linux.sh
- name: Build (Linux)
if: runner.os == 'Linux'
run: bash ./scripts/build-linux.sh
- name: Build (macOS)
if: runner.os == 'macOS'
run: |
yarn clean && yarn build-native
run: bash ./scripts/build-macos.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

# General

yarn clean && yarn build-native -a x86_64 --CDLLAMA_VULKAN=1
yarn clean && yarn build-native -a aarch64 --cc aarch64-linux-gnu-gcc --cxx aarch64-linux-gnu-g++ --CDLLAMA_VULKAN=1
7 changes: 7 additions & 0 deletions scripts/build-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

# General

yarn clean && yarn build-native
17 changes: 17 additions & 0 deletions scripts/build-windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

function resolve_path {
python -c "import os,sys; print(os.path.abspath(sys.argv[1]))" "$1"
}

# General

yarn clean && yarn build-native -a x86_64
yarn clean && yarn build-native -a arm64

# build with CLBlast

yarn clean && yarn build-native -a x86_64 --CDVARIANT=opencl --CDLLAMA_CLBLAST=ON --CDCMAKE_PREFIX_PATH="$(resolve_path 'externals/win32-x64/SDK/lib/cmake/CLBlast')"
yarn clean && yarn build-native -a arm64 --CDVARIANT=opencl --CDLLAMA_CLBLAST=ON --CDCMAKE_PREFIX_PATH="$(resolve_path 'externals/win32-arm64/SDK/lib/cmake/CLBlast')"
13 changes: 13 additions & 0 deletions scripts/prepare-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

sudo apt-get update
sudo apt-get install -qy \
binutils-aarch64-linux-gnu \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
vulkan-sdk \
libvulkan-dev:arm64


2 changes: 2 additions & 0 deletions scripts/prepare-windows.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

mkdir externals || true
cd externals

Expand Down

0 comments on commit d0b9083

Please sign in to comment.