Skip to content

Add per-model sampling defaults configuration #108

Add per-model sampling defaults configuration

Add per-model sampling defaults configuration #108

Workflow file for this run

name: Build and Release
on:
push:
branches:
- '**'
tags:
- 'v*'
permissions:
contents: write
packages: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
suffix: linux-amd64
archive: tar.gz
- goos: linux
goarch: arm64
suffix: linux-arm64
archive: tar.gz
- goos: windows
goarch: amd64
suffix: windows-amd64
archive: zip
- goos: darwin
goarch: amd64
suffix: darwin-amd64
archive: tar.gz
- goos: darwin
goarch: arm64
suffix: darwin-arm64
archive: tar.gz
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
BINARY_NAME=go-llm-proxy
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=go-llm-proxy.exe
fi
go build -trimpath -ldflags "-s -w" -o "${BINARY_NAME}" .
chmod +x "${BINARY_NAME}" 2>/dev/null || true
- name: Package (tar.gz)
if: matrix.archive == 'tar.gz'
run: |
tar -czf go-llm-proxy-${{ matrix.suffix }}.tar.gz go-llm-proxy README.md config.yaml.example
- name: Package (zip)
if: matrix.archive == 'zip'
run: |
zip go-llm-proxy-${{ matrix.suffix }}.zip go-llm-proxy.exe README.md config.yaml.example
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: go-llm-proxy-${{ matrix.suffix }}
path: go-llm-proxy-${{ matrix.suffix }}.${{ matrix.archive }}
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release files
run: |
mkdir -p release
for dir in artifacts/*/; do
cp "$dir"* release/
done
cd release
sha256sum * > checksums.txt
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
release/*
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
docker:
name: Docker Image
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/yatesdr/go-llm-proxy
flavor: |
latest=false
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}