-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (109 loc) · 3.63 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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/[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: 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: 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
yarn clean && yarn build-native -a arm64 --CDLLAMA_CLBLAST=1 --DCMAKE_PREFIX_PATH=externals/CLBlast-1.6.2-windows-x64
- 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/[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
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