forked from kherud/java-llama.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (193 loc) · 6 KB
/
release.yaml
File metadata and controls
206 lines (193 loc) · 6 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Release to Maven Central
on:
workflow_dispatch:
inputs:
build_only:
description: 'Whether to only build the project and skip releasing it (yes/NO)'
required: false
default: 'no'
release:
types: [ created ]
env:
MODEL_URL: "https://huggingface.co/TheBloke/CodeLlama-7B-GGUF/resolve/main/codellama-7b.Q2_K.gguf"
MODEL_NAME: "codellama-7b.Q2_K.gguf"
jobs:
build-linux-docker:
name: Build ${{ matrix.target.os }}-${{ matrix.target.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- {
os: Linux,
arch: x86_64,
image: dockcross-manylinux2014-x64,
}
- {
os: Linux,
arch: aarch64,
image: dockcross-linux-arm64-lts,
}
- {
os: Linux-Android,
arch: aarch64,
image: dockcross-android-arm64,
}
steps:
- uses: actions/checkout@v4
- name: Build libraries
shell: bash
run: |
.github/dockcross/${{ matrix.target.image }} .github/build.sh "-DOS_NAME=${{ matrix.target.os }} -DOS_ARCH=${{ matrix.target.arch }}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
build-macos-native:
name: Build ${{ matrix.target.runner }}
runs-on: ${{ matrix.target.runner }}
strategy:
fail-fast: false
matrix:
target:
- {
runner: macos-13,
cmake: '-DLLAMA_METAL=OFF'
}
- {
runner: macos-14,
cmake: '-DLLAMA_METAL_EMBED_LIBRARY=ON'
}
steps:
- uses: actions/checkout@v4
- name: Build libraries
shell: bash
run: |
mvn compile
.github/build.sh ${{ matrix.target.cmake }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
build-win-native:
name: Build ${{ matrix.target.os }}-${{ matrix.target.arch }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target:
- {
os: Windows,
arch: x86_64,
cmake: '-G "Visual Studio 17 2022" -A "x64"'
}
- {
os: Windows,
arch: aarch64,
cmake: '-G "Visual Studio 17 2022" -A "ARM64"'
}
- {
os: Windows,
arch: x86,
cmake: '-G "Visual Studio 17 2022" -A "Win32"'
}
- {
os: Windows,
arch: arm,
cmake: '-G "Visual Studio 17 2022" -A "ARM"'
}
steps:
- uses: actions/checkout@v4
- name: Build libraries
shell: cmd
run: |
.github\build.bat ${{ matrix.target.cmake }} -DOS_NAME=${{ matrix.target.os }} -DOS_ARCH=${{ matrix.target.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
test-linux:
name: Test Linux
needs: build-linux-docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
- name: Download model
run: curl -L ${MODEL_URL} --create-dirs -o models/${MODEL_NAME}
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Run tests
run: mvn test
# disabled for now, we don't have access to a macos arm64 runner and testing on x86_64 doesn't work
# test-macos:
# name: Test Mac
# needs: build-macos-native
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v3
# with:
# name: artifacts
# path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
# - name: Download model
# run: curl -L ${MODEL_URL} --create-dirs -o models/${MODEL_NAME}
# - uses: actions/setup-java@v4
# with:
# distribution: 'zulu'
# java-version: '11'
# - name: Run tests
# run: mvn test
test-windows:
name: Test Windows
needs: build-win-native
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
- name: Download model
run: curl -L $env:MODEL_URL --create-dirs -o models/$env:MODEL_NAME
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Run tests
run: mvn test
publish:
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.build_only == 'no' }}
needs: [ test-linux,build-macos-native,test-windows ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: mvn --batch-mode -P release -Dmaven.test.skip=true deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}