Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 84 additions & 81 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,97 @@
name: Build CLI Commands

on:
push:
tags:
- "v*"
workflow_dispatch:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: write
Comment on lines +9 to +10
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title contains a spelling error: "perimissions" should be "permissions".

Copilot uses AI. Check for mistakes.

jobs:
build:
name: Build gollama
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
arch: arm64
goos: darwin
goarch: arm64
- os: ubuntu-24.04-arm
arch: arm64
goos: linux
goarch: arm64
- os: ubuntu-latest
arch: amd64
goos: linux
goarch: amd64
- os: windows-latest
arch: amd64
goos: windows
goarch: amd64
build:
name: Build gollama
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
arch: arm64
goos: darwin
goarch: arm64
- os: ubuntu-24.04-arm
arch: arm64
goos: linux
goarch: arm64
- os: ubuntu-latest
arch: amd64
goos: linux
goarch: amd64
- os: windows-latest
arch: amd64
goos: windows
goarch: amd64

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"

- name: Build gollama-client (Unix)
if: matrix.goos != 'windows'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: make gollama-client
- name: Build gollama-client (Unix)
if: matrix.goos != 'windows'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: make gollama-client

- name: Build gollama-client (Windows)
if: matrix.goos == 'windows'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
shell: bash
run: |
mkdir -p build
go build -ldflags "-s -w" -tags client -o build/gollama.exe ./cmd/gollama
- name: Build gollama-client (Windows)
if: matrix.goos == 'windows'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
shell: bash
run: |
mkdir -p build
go build -ldflags "-s -w" -tags client -o build/gollama.exe ./cmd/gollama

- name: Rename binary for release
shell: bash
run: |
if [ "${{ matrix.goos }}" = "windows" ]; then
mv build/gollama.exe build/gollama-${{ matrix.goos }}-${{ matrix.goarch }}.exe
else
mv build/gollama build/gollama-${{ matrix.goos }}-${{ matrix.goarch }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: gollama-${{ matrix.goos }}-${{ matrix.goarch }}
path: build/gollama-${{ matrix.goos }}-${{ matrix.goarch }}*
- name: Rename binary for release
shell: bash
run: |
if [ "${{ matrix.goos }}" = "windows" ]; then
mv build/gollama.exe build/gollama-${{ matrix.goos }}-${{ matrix.goarch }}.exe
else
mv build/gollama build/gollama-${{ matrix.goos }}-${{ matrix.goarch }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: gollama-${{ matrix.goos }}-${{ matrix.goarch }}
path: build/gollama-${{ matrix.goos }}-${{ matrix.goarch }}*

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/**/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/**/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}