Files
ffmpeg-worker/.gitea/workflows/release.yml
Bill 830715abb3
All checks were successful
Test and Build / test (push) Successful in 1m33s
Test and Build / build (push) Successful in 8s
fix(ci): skip docker if unavailable, no latest tag for prereleases
Gitea: Skip docker build gracefully if docker command not available
GitHub: Only tag as latest for stable releases (not alpha/beta/rc)
2025-11-30 22:36:03 -05:00

58 lines
1.5 KiB
YAML

name: Test and Build
on:
push:
tags:
- 'v*.*.*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Add uv to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up Python
run: $HOME/.local/bin/uv python install 3.12
- name: Install dependencies
run: $HOME/.local/bin/uv sync
- name: Install FFmpeg
run: |
if command -v ffmpeg &> /dev/null; then
echo "FFmpeg already installed"
elif command -v sudo &> /dev/null; then
sudo apt-get update && sudo apt-get install -y ffmpeg
else
apt-get update && apt-get install -y ffmpeg
fi
- name: Run tests
run: $HOME/.local/bin/uv run pytest tests/ -v --ignore=tests/test_integration.py
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build Docker image
run: |
if command -v docker &> /dev/null; then
docker build -t ffmpeg-worker:${{ steps.version.outputs.VERSION }} .
docker tag ffmpeg-worker:${{ steps.version.outputs.VERSION }} ffmpeg-worker:latest
docker images | grep ffmpeg-worker
else
echo "Docker not available - skipping build"
fi