Skip to content
Draft
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions .github/actions/build-container/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ inputs:
skyeye-version:
description: 'Version to use in build args'
required: true
tag-suffix:
description: 'Suffix appended to generated image tags (e.g. "-vulkan")'
required: false
default: ''
backend:
description: 'Which whisper.cpp backend to build (cpu or vulkan)'
required: false
default: 'cpu'
runs:
using: composite
steps:
Expand All @@ -35,12 +43,15 @@ runs:
uses: docker/metadata-action@v5
with:
images: ${{ inputs.registry }}/${{ inputs.image-name }}
flavor: |
suffix=${{ inputs.tag-suffix }},onlatest=true
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
build-args: |
SKYEYE_VERSION: ${{ inputs.skyeye-version }}
WHISPER_CPP_BACKEND: ${{ inputs.backend }}
target: ${{ inputs.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/build-whisper/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ inputs:
description: 'The shell to use'
required: true
default: 'bash'
backend:
description: 'Which whisper.cpp backend to build (cpu or vulkan)'
required: true
default: 'cpu'
runs:
using: composite
steps:
- name: Build whisper.cpp
shell: ${{ inputs.shell }}
run: make whisper
run: make whisper WHISPER_CPP_BACKEND=${{ inputs.backend }}
176 changes: 112 additions & 64 deletions .github/workflows/skyeye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,51 @@ on:
permissions: {}
jobs:
lint:
name: Lint
name: Lint (${{ matrix.backend }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
backend: [cpu, vulkan]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Install Vulkan dependencies
if: matrix.backend == 'vulkan'
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev glslc
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
backend: ${{ matrix.backend }}
- name: Lint
run: |
make lint
make vet
make fix
make format
go mod tidy
git diff --exit-code
run: WHISPER_CPP_BACKEND=${{ matrix.backend }} make ci-lint
test:
name: Test
name: Test (${{ matrix.backend }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
backend: [cpu, vulkan]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Install Vulkan dependencies
if: matrix.backend == 'vulkan'
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev glslc
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
backend: ${{ matrix.backend }}
- name: Test
run: make test
run: WHISPER_CPP_BACKEND=${{ matrix.backend }} make test
build-linux-amd64:
name: Build on Linux AMD64
runs-on: ubuntu-latest
Expand All @@ -54,23 +66,8 @@ jobs:
uses: ./.github/actions/setup
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
- name: Build SkyEye
run: make skyeye
- name: Build SkyEye Scaler
run: make skyeye-scaler
- name: Create dist
shell: bash
run: |
mkdir -p dist/skyeye-linux-amd64/docs/
cp skyeye dist/skyeye-linux-amd64/skyeye
cp skyeye-scaler dist/skyeye-linux-amd64/skyeye-scaler
chmod +x dist/skyeye-linux-amd64/skyeye
chmod +x dist/skyeye-linux-amd64/skyeye-scaler
cp README.md dist/skyeye-linux-amd64/README.md
cp LICENSE dist/skyeye-linux-amd64/LICENSE
cp config.yaml dist/skyeye-linux-amd64/config.yaml
cp docs/*.md dist/skyeye-linux-amd64/docs/
tar -czf dist/skyeye-linux-amd64.tar.gz -C dist skyeye-linux-amd64
run: make dist-linux
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
Expand All @@ -79,6 +76,32 @@ jobs:
path: dist/skyeye-linux-amd64.tar.gz
if-no-files-found: error
overwrite: true
build-linux-amd64-vulkan:
name: Build on Linux AMD64 (Vulkan)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Install Vulkan dependencies
run: sudo apt-get update && sudo apt-get install -y libvulkan-dev glslc
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
backend: vulkan
- name: Create dist
run: make dist-linux-vulkan
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: skyeye-linux-amd64-vulkan.tar.gz
path: dist/skyeye-linux-amd64-vulkan.tar.gz
if-no-files-found: error
overwrite: true
build-macos-arm64:
name: Build on macOS
runs-on: macos-latest
Expand All @@ -88,30 +111,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
shell: bash
run: make install-macos-dependencies
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
os: macos
arch: arm64
- name: Build SkyEye
run: make skyeye
- name: Build SkyEye Scaler
run: make skyeye-scaler
- name: Create dist
shell: bash
run: |
mkdir -p dist/skyeye-macos-arm64/docs/
cp skyeye dist/skyeye-macos-arm64/skyeye
cp skyeye-scaler dist/skyeye-macos-arm64/skyeye-scaler
chmod +x dist/skyeye-macos-arm64/skyeye
chmod +x dist/skyeye-macos-arm64/skyeye-scaler
cp README.md dist/skyeye-macos-arm64/README.md
cp LICENSE dist/skyeye-macos-arm64/LICENSE
cp config.yaml dist/skyeye-macos-arm64/config.yaml
cp docs/*.md dist/skyeye-macos-arm64/docs/
tar -czf dist/skyeye-macos-arm64.tar.gz -C dist skyeye-macos-arm64
run: make dist-macos
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -151,29 +158,9 @@ jobs:
with:
os: windows
shell: msys2 {0}
- name: Build Skyeye
shell: msys2 {0}
run: make skyeye.exe
- name: Build Skyeye Scaler
shell: msys2 {0}
run: make skyeye-scaler.exe
- name: Create dist
shell: msys2 {0}
run: |
mkdir -p dist/skyeye-windows-amd64/docs/
cp skyeye.exe dist/skyeye-windows-amd64/skyeye.exe
cp skyeye-scaler.exe dist/skyeye-windows-amd64/skyeye-scaler.exe
curl -fsL https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe -o winsw.exe
cp README.md dist/skyeye-windows-amd64/README.md
cp LICENSE dist/skyeye-windows-amd64/LICENSE
cp config.yaml dist/skyeye-windows-amd64/config.yaml
cp docs/*.md dist/skyeye-windows-amd64/docs/
cp winsw.exe dist/skyeye-windows-amd64/skyeye-service.exe
cp init/winsw/skyeye-service.yml dist/skyeye-windows-amd64/skyeye-service.yml
cp winsw.exe dist/skyeye-windows-amd64/skyeye-scaler-service.exe
cp init/winsw/skyeye-scaler-service.yml dist/skyeye-windows-amd64/skyeye-scaler-service.yml
cd dist
zip -r skyeye-windows-amd64.zip skyeye-windows-amd64
run: make dist-windows
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
Expand All @@ -182,6 +169,53 @@ jobs:
path: dist/skyeye-windows-amd64.zip
if-no-files-found: error
overwrite: true
build-windows-amd64-vulkan:
name: Build on Windows AMD64 (Vulkan)
runs-on: windows-latest
permissions:
contents: read
env:
GOROOT: /ucrt64/lib/go
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: |
base-devel
git
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-opus
mingw-w64-ucrt-x86_64-libsoxr
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-go
mingw-w64-ucrt-x86_64-curl
mingw-w64-ucrt-x86_64-vulkan-headers
mingw-w64-ucrt-x86_64-vulkan-loader
mingw-w64-ucrt-x86_64-shaderc
mingw-w64-ucrt-x86_64-spirv-tools
zip
- name: Build whisper.cpp
uses: ./.github/actions/build-whisper
with:
os: windows
shell: msys2 {0}
backend: vulkan
- name: Create dist
shell: msys2 {0}
run: make dist-windows-vulkan
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: skyeye-windows-amd64-vulkan.zip
path: dist/skyeye-windows-amd64-vulkan.zip
if-no-files-found: error
overwrite: true
build-image:
name: Build container image
if: "!startsWith(github.ref, 'refs/tags/')"
Expand All @@ -205,7 +239,9 @@ jobs:
- lint
- test
- build-linux-amd64
- build-linux-amd64-vulkan
- build-windows-amd64
- build-windows-amd64-vulkan
- build-macos-arm64
runs-on: ubuntu-latest
steps:
Expand All @@ -222,8 +258,10 @@ jobs:
with:
files: |
dist/skyeye-linux-amd64.tar.gz
dist/skyeye-linux-amd64-vulkan.tar.gz
dist/skyeye-macos-arm64.tar.gz
dist/skyeye-windows-amd64.zip
dist/skyeye-windows-amd64-vulkan.zip
token: ${{ secrets.RELEASE_TOKEN }}
push-images:
name: Build and push container images
Expand Down Expand Up @@ -256,3 +294,13 @@ jobs:
image-name: ${{ github.repository }}-scaler
target: skyeye-scaler
skyeye-version: ${{ env.GITHUB_REF_NAME }}
- name: Build and push Vulkan image
uses: ./.github/actions/build-container
with:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
image-name: ${{ github.repository }}
target: skyeye
tag-suffix: '-vulkan'
skyeye-version: ${{ env.GITHUB_REF_NAME }}
backend: vulkan
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ARG SKYEYE_VERSION
ARG WHISPER_CPP_BACKEND=cpu

FROM golang:1.26 AS builder
ARG WHISPER_CPP_BACKEND
RUN apt-get update && apt-get install -y \
git \
make \
Expand All @@ -8,25 +11,31 @@ RUN apt-get update && apt-get install -y \
gcc \
libopus-dev \
libsoxr-dev \
&& if [ "$WHISPER_CPP_BACKEND" = "vulkan" ]; then \
apt-get install -y libvulkan-dev glslc; \
fi \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /skyeye
COPY third_party third_party
COPY Makefile Makefile
RUN make whisper
COPY go.mod go.mod
COPY go.sum go.sum
RUN make whisper WHISPER_CPP_BACKEND=$WHISPER_CPP_BACKEND
COPY go.mod go.sum ./
RUN go mod download -x
COPY cmd cmd
COPY internal internal
COPY pkg pkg
RUN make skyeye
RUN make skyeye WHISPER_CPP_BACKEND=$WHISPER_CPP_BACKEND
RUN make skyeye-scaler

FROM debian:bookworm-slim AS base
ARG WHISPER_CPP_BACKEND
RUN apt-get update && apt-get install -y \
ca-certificates \
libopus0 \
libsoxr0 \
&& if [ "$WHISPER_CPP_BACKEND" = "vulkan" ]; then \
apt-get install -y libvulkan1 mesa-vulkan-drivers; \
fi \
&& rm -rf /var/lib/apt/lists/*

FROM base AS skyeye
Expand Down
Loading
Loading