ci: build and publish ARM64 image with Gitea Actions

This commit is contained in:
wimby
2026-09-25 20:39:00 +02:00
parent 93151a6c0b
commit 338ee8efb4
2 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
name: Build TubeSync image
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
container:
runs-on: ubuntu-latest
steps:
- name: Install build tools
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl docker.io jq
rm -rf /var/lib/apt/lists/*
- name: Check out repository
uses: actions/checkout@v4
- name: Resolve upstream dependency versions
shell: bash
run: |
set -euo pipefail
ffmpeg_json="$(curl -fsSL 'https://api.github.com/repos/yt-dlp/FFmpeg-Builds/releases?per_page=10')"
ffmpeg_tag="$(jq -r '[.[] | select((.draft or .prerelease) | not)][0].tag_name' <<<"${ffmpeg_json}")"
ffmpeg_date="${ffmpeg_tag#autobuild-}"
ffmpeg_version="$(jq -r '[.[] | select((.draft or .prerelease) | not)][0].assets[].name | select(test("-linuxarm64-")) | capture("^ffmpeg-(?<v>.+)-linuxarm64-").v' <<<"${ffmpeg_json}" | head -n1)"
ytdlp_date="$(curl -fsSL https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest | jq -r .tag_name)"
ejs_version="$(curl -fsSL https://api.github.com/repos/yt-dlp/ejs/releases/latest | jq -r .tag_name)"
test -n "${ffmpeg_date}"
test -n "${ffmpeg_version}"
test -n "${ytdlp_date}"
test -n "${ejs_version}"
{
echo "FFMPEG_DATE=${ffmpeg_date}"
echo "FFMPEG_VERSION=${ffmpeg_version}"
echo "YTDLP_DATE=${ytdlp_date}"
echo "YTDLP_EJS_VERSION=${ejs_version}"
} >> "${GITHUB_ENV}"
- name: Log in to Gitea registry
shell: bash
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
set -euo pipefail
echo "${GITEA_TOKEN}" | docker login git.wimby.cz --username "${GITHUB_ACTOR}" --password-stdin
- name: Build image
shell: bash
run: |
set -euo pipefail
short_sha="${GITHUB_SHA:0:12}"
DOCKER_BUILDKIT=1 docker build \
--build-arg FFMPEG_DATE="${FFMPEG_DATE}" \
--build-arg FFMPEG_VERSION="${FFMPEG_VERSION}" \
--build-arg YTDLP_DATE="${YTDLP_DATE}" \
--build-arg YTDLP_EJS_VERSION="${YTDLP_EJS_VERSION}" \
--tag "git.wimby.cz/wimby/tubesync:latest" \
--tag "git.wimby.cz/wimby/tubesync:${short_sha}" \
.
- name: Push image
shell: bash
run: |
set -euo pipefail
short_sha="${GITHUB_SHA:0:12}"
docker push "git.wimby.cz/wimby/tubesync:${short_sha}"
docker push "git.wimby.cz/wimby/tubesync:latest"

28
WIMBY.md Normal file
View File

@@ -0,0 +1,28 @@
# Wimby TubeSync fork
This fork tracks upstream TubeSync at https://github.com/meeb/tubesync and carries a small set of local patches as separate commits.
## Updating from upstream
The local clone is expected to have:
- `origin` = `git@git.wimby.cz:wimby/tubesync.git`
- `upstream` = `https://github.com/meeb/tubesync.git`
Update with:
```sh
git fetch upstream
git checkout main
git rebase upstream/main
git push origin main
```
If upstream changes the same code, resolve the rebase conflict and keep only the local behavior that is still required.
A push to `main` builds and publishes:
- `git.wimby.cz/wimby/tubesync:latest`
- `git.wimby.cz/wimby/tubesync:<12-character-commit-sha>`
The deployment should normally track `:latest`; the SHA tag is available for rollback.