Skip to content

Release

Release #33

Workflow file for this run

name: Release
on:
push:
tags:
- v*
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/setup-node@v4.0.2
with:
node-version: 20
cache: 'yarn'
- name: node_modules cache
uses: actions/cache@v4.0.2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- name: externals cache
uses: actions/cache@v4.0.2
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/setup-vulkan-sdk@v1.2.0
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++ --CDLLAMA_VULKAN=1
- name: Prepare SDK (Windows)
if: runner.os == 'Windows'
shell: bash
run: bash ./scripts/prepare-windows.sh
- name: Build (Windows)
if: runner.os == 'Windows'
run: |
yarn clean && yarn build-native -a x86_64
yarn clean && yarn build-native -a arm64
yarn clean && yarn build-native -a x86_64 --CDVARIANT=opencl --CDLLAMA_CLBLAST=ON --CDCMAKE_PREFIX_PATH=%cd%/externals/win32-x64/SDK/lib/cmake/CLBlast
yarn clean && yarn build-native -a arm64 --CDVARIANT=opencl --CDLLAMA_CLBLAST=ON --CDCMAKE_PREFIX_PATH=%cd%/externals/win32-arm64/SDK/lib/cmake/CLBlast
- 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:
permissions:
contents: write
pull-requests: read
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-node@v4.0.2
with:
node-version: 20
cache: 'yarn'
- name: node_modules cache
uses: actions/cache@v4.0.2
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
uses: JS-DevTools/npm-publish@v3
with:
token: ${{secrets.NPM_TOKEN}}
- name: Draft release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true