Release #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
- name: node_modules cache | |
uses: actions/[email protected] | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
- 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: Prepare OpenCL SDK (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
mkdir externals | |
cd externals | |
curl -L https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v2023.12.14/OpenCL-SDK-v2023.12.14-Win-x64.zip -o OpenCL-SDK-v2023.12.14-Win-x64.zip | |
7z x OpenCL-SDK-v2023.12.14-Win-x64.zip -oOpenCL-SDK | |
curl -L https://github.com/CNugteren/CLBlast/releases/download/1.6.2/CLBlast-1.6.2-windows-x64.zip -o CLBlast.zip | |
7z x CLBlast.zip | |
7z x CLBlast*.7z | |
- name: Prepare OpenCL SDK (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -qy opencl-headers ocl-icd-dev ocl-icd-opencl-dev | |
curl -L https://github.com/CNugteren/CLBlast/releases/download/1.6.2/CLBlast-1.6.2-linux-x86_64.zip -o /tmp/CLBlast.zip | |
unzip /tmp/CLBlast.zip -d /tmp | |
tar -xf /tmp/CLBlast*.tar.gz -C /tmp | |
- 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++ --CDLLAMA_CLBLAST=1 --CDCLBlast_DIR=/tmp/CLBlast-1.6.2-linux-x86_64 | |
- name: Build (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
yarn clean && yarn build-native -a x86_64 --CDLLAMA_CLBLAST=1 --DCMAKE_PREFIX_PATH=externals/CLBlast-1.6.2-windows-x64 -G "Visual Studio 17 2022" | |
yarn clean && yarn build-native -a x86_64 --CDLLAMA_CLBLAST=1 --DCMAKE_PREFIX_PATH=externals/CLBlast-1.6.2-windows-x64 -G "Visual Studio 17 2022" | |
- name: Build (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
yarn clean && yarn build-native | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bin-${{ matrix.os }} | |
path: bin | |
retention-days: 3 | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/[email protected] | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
- name: node_modules cache | |
uses: actions/[email protected] | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Download bundled files | |
uses: actions/download-artifact@v4 | |
with: | |
path: bin | |
pattern: bin-* | |
merge-multiple: true | |
- run: yarn install | |
- run: yarn build | |
- name: Publish to NPM | |
run: yarn publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |