Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 43d3fb3

Browse files
authoredMay 23, 2023
ci: add binary releases pipelines (#358)
1 parent f5f8c68 commit 43d3fb3

File tree

6 files changed

+115
-41
lines changed

6 files changed

+115
-41
lines changed
 

‎.github/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .github/release.yml
2+
3+
changelog:
4+
exclude:
5+
labels:
6+
- ignore-for-release
7+
categories:
8+
- title: Breaking Changes 🛠
9+
labels:
10+
- Semver-Major
11+
- breaking-change
12+
- title: "Bug fixes :bug:"
13+
labels:
14+
- bug
15+
- title: Exciting New Features 🎉
16+
labels:
17+
- Semver-Minor
18+
- enhancement
19+
- title: 👒 Dependencies
20+
labels:
21+
- dependencies
22+
- title: Other Changes
23+
labels:
24+
- "*"

‎.github/workflows/release.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build and Release
2+
3+
on: push
4+
5+
jobs:
6+
build-linux:
7+
strategy:
8+
matrix:
9+
include:
10+
- build: 'avx2'
11+
defines: ''
12+
- build: 'avx'
13+
defines: '-DLLAMA_AVX2=OFF'
14+
- build: 'avx512'
15+
defines: '-DLLAMA_AVX512=ON'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Clone
19+
uses: actions/checkout@v3
20+
with:
21+
submodules: true
22+
- name: Dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install build-essential ffmpeg
26+
- name: Build
27+
id: build
28+
env:
29+
CMAKE_ARGS: "${{ matrix.define }}"
Code has comments. Press enter to view.
30+
BUILD_ID: "${{ matrix.build }}"
31+
run: |
32+
make dist
33+
- uses: actions/upload-artifact@v3
34+
with:
35+
name: ${{ matrix.build }}
36+
path: release/
37+
- name: Release
38+
uses: softprops/action-gh-release@v1
39+
if: startsWith(github.ref, 'refs/tags/')
40+
with:
41+
files: |
42+
release/*
43+
44+
build-macOS:
45+
strategy:
46+
matrix:
47+
include:
48+
- build: 'avx2'
49+
defines: ''
50+
- build: 'avx'
51+
defines: '-DLLAMA_AVX2=OFF'
52+
- build: 'avx512'
53+
defines: '-DLLAMA_AVX512=ON'
54+
runs-on: macOS-latest
55+
steps:
56+
- name: Clone
57+
uses: actions/checkout@v3
58+
with:
59+
submodules: true
60+
61+
- name: Dependencies
62+
run: |
63+
brew update
64+
brew install sdl2 ffmpeg
65+
- name: Build
66+
id: build
67+
env:
68+
CMAKE_ARGS: "${{ matrix.define }}"
69+
BUILD_ID: "${{ matrix.build }}"
70+
run: |
71+
make dist
72+
- uses: actions/upload-artifact@v3
73+
with:
74+
name: ${{ matrix.build }}
75+
path: release/
76+
- name: Release
77+
uses: softprops/action-gh-release@v1
78+
if: startsWith(github.ref, 'refs/tags/')
79+
with:
80+
files: |
81+
release/*

‎.github/workflows/release.yml.disabled

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ local-ai
1616
models/*
1717
test-models/
1818

19+
release/
20+
1921
# just in case
2022
.DS_Store

‎.goreleaser.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ CGO_LDFLAGS?=
1717
CUDA_LIBPATH?=/usr/local/cuda/lib64/
1818
STABLEDIFFUSION_VERSION?=c0748eca3642d58bcf9521108bcee46959c647dc
1919
GO_TAGS?=
20+
BUILD_ID?=git
2021

2122
OPTIONAL_TARGETS?=
2223

24+
OS := $(shell uname -s)
25+
ARCH := $(shell uname -m)
2326
GREEN := $(shell tput -Txterm setaf 2)
2427
YELLOW := $(shell tput -Txterm setaf 3)
2528
WHITE := $(shell tput -Txterm setaf 7)
@@ -186,6 +189,7 @@ clean: ## Remove build related file
186189
rm -rf ./bloomz
187190
rm -rf ./whisper.cpp
188191
rm -rf $(BINARY_NAME)
192+
rm -rf release/
189193

190194
## Build:
191195

@@ -195,6 +199,10 @@ build: prepare ## Build the project
195199
$(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET})
196200
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=${C_INCLUDE_PATH} LIBRARY_PATH=${LIBRARY_PATH} $(GOCMD) build -tags "$(GO_TAGS)" -x -o $(BINARY_NAME) ./
197201

202+
dist: build
203+
mkdir -p release
204+
cp $(BINARY_NAME) release/$(BINARY_NAME)-$(BUILD_ID)-$(OS)-$(ARCH)
205+
198206
generic-build: ## Build the project using generic
199207
BUILD_TYPE="generic" $(MAKE) build
200208

0 commit comments

Comments
 (0)
Please sign in to comment.