Skip to content

Commit 0e4802b

Browse files
authored
ci: add ubuntu latest release and fix missing build number (mac & ubuntu) (#6748)
1 parent 637e9a8 commit 0e4802b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
- name: Clone
3333
id: checkout
3434
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
3537

3638
- name: Dependencies
3739
id: depends
@@ -88,6 +90,8 @@ jobs:
8890
- name: Clone
8991
id: checkout
9092
uses: actions/checkout@v4
93+
with:
94+
fetch-depth: 0
9195

9296
- name: Dependencies
9397
id: depends
@@ -206,6 +210,8 @@ jobs:
206210
- name: Clone
207211
id: checkout
208212
uses: actions/checkout@v4
213+
with:
214+
fetch-depth: 0
209215

210216
- name: Dependencies
211217
id: depends
@@ -238,6 +244,33 @@ jobs:
238244
./bin/convert-llama2c-to-ggml --copy-vocab-from-model ./tok512.bin --llama2c-model stories260K.bin --llama2c-output-model stories260K.gguf
239245
./bin/main -m stories260K.gguf -p "One day, Lily met a Shoggoth" -n 500 -c 256
240246
247+
- name: Determine tag name
248+
id: tag
249+
shell: bash
250+
run: |
251+
BUILD_NUMBER="$(git rev-list --count HEAD)"
252+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
253+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
254+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
255+
else
256+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
257+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
258+
fi
259+
260+
- name: Pack artifacts
261+
id: pack_artifacts
262+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
263+
run: |
264+
cp LICENSE ./build/bin/
265+
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip ./build/bin/*
266+
267+
- name: Upload artifacts
268+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
269+
uses: actions/upload-artifact@v4
270+
with:
271+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.zip
272+
name: llama-bin-ubuntu-x64.zip
273+
241274
# ubuntu-latest-cmake-sanitizer:
242275
# runs-on: ubuntu-latest
243276
#

0 commit comments

Comments
 (0)