-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
244 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
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') }} | ||
- run: yarn install | ||
- name: Build CPU (x86_64) | ||
run: yarn clean && yarn build-native | ||
- name: Build CPU (arm64) | ||
run: yarn clean && yarn build-native -A arm64 | ||
- name: Prepare Vulkan SDK | ||
if: runner.os == 'ubuntu-latest' | ||
uses: humbletim/[email protected] | ||
with: | ||
vulkan-query-version: 1.3.204.0 | ||
vulkan-components: Vulkan-Headers, Vulkan-Loader | ||
vulkan-use-cache: true | ||
- name: Build with Vulkan | ||
if: runner.os == 'ubuntu-latest' | ||
run: yarn clean && yarn build-native --CDVARIANT=vulkan --CDLLAMA_VULKAN=1 | ||
- name: Build with OpenCL | ||
if: runner.os == 'windows-latest' | ||
run: yarn clean && yarn build-native --CDVARIANT=opencl --CDLLAMA_OPENCL=1 | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bin | ||
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: | ||
name: bin | ||
path: bin | ||
- run: yarn install | ||
- run: yarn build | ||
- name: Publish to NPM | ||
run: yarn publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
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
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
Oops, something went wrong.