Skip to content

Commit 23a5afa

Browse files
committed
Create release.yaml
1 parent c658ead commit 23a5afa

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/release.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
cuda: ['12.1.0', '11.7.1']
12+
os:
13+
- ubuntu-20.04
14+
arch:
15+
- amd64
16+
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- run: |
20+
case "${{ runner.os }}" in
21+
'Linux') echo 'linux' ;;
22+
'Windows') echo 'windows' ;;
23+
'macOS') echo 'darwin' ;;
24+
esac | xargs -I{} echo 'GOOS={}' | tee -a $GITHUB_ENV
25+
26+
case "${{ runner.arch }}" in
27+
'X86') echo 'i386' ;;
28+
'X64') echo 'amd64' ;;
29+
'ARM') echo 'arm' ;;
30+
'ARM64') echo 'arm64' ;;
31+
esac | xargs -I{} echo 'GOARCH={}' | tee -a $GITHUB_ENV
32+
33+
- uses: Jimver/[email protected]
34+
id: cuda-toolkit
35+
with:
36+
cuda: ${{ matrix.cuda }}
37+
use-github-cache: true
38+
39+
- uses: actions/checkout@v3
40+
with:
41+
submodules: recursive
42+
43+
- name: Setup Go environment
44+
uses: actions/setup-go@v4
45+
with:
46+
go-version: 1.21
47+
48+
- name: Install Linux build dependencies
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y build-essential cmake
52+
nvidia-smi
53+
if: ${{ runner.os == 'Linux' }}
54+
55+
# - name: Install macOS build dependencies
56+
# run: |
57+
# brew update
58+
# brew install cmake
59+
# if: ${{ runner.os == 'macOS' }}
60+
61+
# - name: Install Windows build dependencies
62+
# run: |
63+
# choco install mingw cmake
64+
# if: ${{ runner.os == 'Windows' }}
65+
66+
- run: |
67+
go generate ./...
68+
go build -o ollama-$GOOS-$GOARCH
69+
zip ollama-$GOOS-$GOARCH.zip ollama-$GOOS-$GOARCH
70+
env:
71+
CGO_ENABLED: 1
72+
GOFLAGS: >-
73+
'-ldflags=-w -s
74+
"-X=github.com/brucemacd/ollama/version.Version=${{ github.ref_name }}"
75+
"-X=github.com/brucemacd/ollama/server.mode=release"'
76+
77+
- name: Upload build artifact
78+
uses: actions/upload-artifact@v2
79+
with:
80+
name: ollama-${{ env.GOOS }}-${{ env.GOARCH }}
81+
path: ollama-${{ env.GOOS }}-${{ env.GOARCH }}.zip

0 commit comments

Comments
 (0)