v0.13.2 #656
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SkyEye | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Build whisper.cpp | |
uses: ./.github/actions/build-whisper | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
- name: vet | |
run: make vet | |
- name: Format | |
run: go fmt ./... && git diff --exit-code | |
- name: Tidy | |
run: go mod tidy && git diff --exit-code | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Build whisper.cpp | |
uses: ./.github/actions/build-whisper | |
- name: Test | |
run: | | |
go run gotest.tools/gotestsum -- -tags nolibopusfile ./... | |
build-linux-amd64: | |
name: Build on Linux AMD64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
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 | |
- name: Upload artifact | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: skyeye-linux-amd64.tar.gz | |
path: dist/skyeye-linux-amd64.tar.gz | |
if-no-files-found: error | |
overwrite: true | |
build-macos-arm64: | |
name: Build on macOS | |
runs-on: macos-latest | |
steps: | |
- 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 | |
cc: clang | |
- 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 | |
- name: Upload artifact | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: skyeye-macos-arm64.tar.gz | |
path: dist/skyeye-macos-arm64.tar.gz | |
if-no-files-found: error | |
overwrite: true | |
build-windows-amd64: | |
name: Build on Windows AMD64 | |
runs-on: windows-latest | |
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-gcc | |
mingw-w64-ucrt-x86_64-toolchain | |
mingw-w64-ucrt-x86_64-opus | |
mingw-w64-ucrt-x86_64-libsoxr | |
mingw-w64-ucrt-x86_64-openblas | |
mingw-w64-ucrt-x86_64-gcc | |
mingw-w64-ucrt-x86_64-go | |
mingw-w64-ucrt-x86_64-curl | |
zip | |
- name: Build whisper.cpp | |
uses: ./.github/actions/build-whisper | |
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 dist/skyeye-windows-amd64/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 init/winsw/skyeye-service.yaml dist/skyeye-windows-amd64/skyeye-service.yaml | |
cp init/winsw/skyeye-scaler-service.yaml dist/skyeye-windows-amd64/skyeye-scaler-service.yaml | |
cd dist | |
zip -r skyeye-windows-amd64.zip skyeye-windows-amd64 | |
- name: Upload artifact | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: skyeye-windows-amd64.zip | |
path: dist/skyeye-windows-amd64.zip | |
if-no-files-found: error | |
overwrite: true | |
build-image: | |
name: Build container image | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: | | |
SKYEYE_VERSION: ${{ env.GITHUB_REF_NAME }} | |
release: | |
name: Upload release assets | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- lint | |
- test | |
- build-linux-amd64 | |
- build-windows-amd64 | |
- build-macos-arm64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: skyeye-* | |
path: dist | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
dist/skyeye-linux-amd64.tar.gz | |
dist/skyeye-macos-arm64.tar.gz | |
dist/skyeye-windows-amd64.zip | |
token: ${{ secrets.RELEASE_TOKEN }} | |
push-images: | |
name: Build and push container images | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- lint | |
- test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build and push image | |
uses: ./.github/actions/build-container | |
with: | |
registry-username: ${{ github.actor }} | |
registry-password: ${{ secrets.GITHUB_TOKEN }} | |
image-name: ${{ github.repository }} | |
target: skyeye | |
skyeye-version: ${{ env.GITHUB_REF_NAME }} | |
- name: Build and push scaler image | |
uses: ./.github/actions/build-container | |
with: | |
registry-username: ${{ github.actor }} | |
registry-password: ${{ secrets.GITHUB_TOKEN }} | |
image-name: ${{ github.repository }}-scaler | |
target: skyeye-scaler | |
skyeye-version: ${{ env.GITHUB_REF_NAME }} |