ci: build and test every PR, release on tags, and add AUR packages (#15)
Co-authored-by: Tri Vo Khac <git@trivk.dev>
This commit was merged in pull request #15.
This commit is contained in:
1 parent
bcfc2f3f6a
commit
8c57c9ddb6
8 files changed
+236
No files matched your search
@@ -0,0 +1,27 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
# Arch Linux only ships x86_64 images, so pick an amd64 runner.
|
||||||
|
runs-on: amd64
|
||||||
|
container: archlinux:latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pacman -Syu --noconfirm --needed git nodejs base-devel cmake ninja extra-cmake-modules \
|
||||||
|
qt6-base qt6-declarative kirigami ki18n kcoreaddons kcrash kconfig \
|
||||||
|
mpvqt qcoro qtkeychain-qt6 ffmpeg
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Configure
|
||||||
|
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
|
||||||
|
- name: Build
|
||||||
|
run: cmake --build build
|
||||||
|
- name: Test
|
||||||
|
env:
|
||||||
|
QT_QPA_PLATFORM: offscreen
|
||||||
|
run: ctest --test-dir build --output-on-failure
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v*']
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
# Arch Linux only ships x86_64 images, so pick an amd64 runner.
|
||||||
|
runs-on: amd64
|
||||||
|
container: archlinux:latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pacman -Syu --noconfirm --needed git nodejs base-devel cmake ninja extra-cmake-modules \
|
||||||
|
qt6-base qt6-declarative qt6-svg qt6-wayland kirigami ki18n kcoreaddons kcrash kconfig \
|
||||||
|
mpvqt qcoro qtkeychain-qt6 ffmpeg plasma-integration qqc2-desktop-style breeze union \
|
||||||
|
curl jq file
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Source tarball
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory "$PWD"
|
||||||
|
version="${GITHUB_REF_NAME#v}"
|
||||||
|
mkdir -p dist
|
||||||
|
git archive --format=tar --prefix="qtpotato-$version/" "$GITHUB_REF_NAME" \
|
||||||
|
| gzip -n > "dist/qtpotato-$version.tar.gz"
|
||||||
|
- name: AppImage
|
||||||
|
run: |
|
||||||
|
LDAI_OUTPUT="$PWD/dist/QtPotato-${GITHUB_REF_NAME#v}-x86_64.AppImage" \
|
||||||
|
packaging/appimage/build-appimage.sh "$PWD/build-appimage"
|
||||||
|
- name: Publish release
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
sha256sum -- * > SHA256SUMS
|
||||||
|
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY"
|
||||||
|
id=$(jq -n --arg tag "$GITHUB_REF_NAME" '{tag_name: $tag, name: ("QtPotato " + ($tag | ltrimstr("v")))}' \
|
||||||
|
| curl -fsS -X POST -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||||
|
--data @- "$api/releases" | jq -r .id)
|
||||||
|
for f in *; do
|
||||||
|
curl -fsS -X POST -H "Authorization: token $TOKEN" \
|
||||||
|
-F "attachment=@$f" "$api/releases/$id/assets?name=$f" > /dev/null
|
||||||
|
done
|
||||||
@@ -33,6 +33,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase()
|
||||||
|
{
|
||||||
|
// The C locale's collation is case-sensitive, so the sort order would depend on $LANG.
|
||||||
|
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
||||||
|
}
|
||||||
|
|
||||||
void sortsEpisodesNaturallyAndSkipsOtherFiles()
|
void sortsEpisodesNaturallyAndSkipsOtherFiles()
|
||||||
{
|
{
|
||||||
QTemporaryDir dir;
|
QTemporaryDir dir;
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
pkgbase = qtpotato-git
|
||||||
|
pkgdesc = KDE video player built on mpv that translates subtitles with an LLM (development version)
|
||||||
|
pkgver = 0.1.0
|
||||||
|
pkgrel = 1
|
||||||
|
url = https://git.trivk.dev/tri/QtPotato
|
||||||
|
arch = x86_64
|
||||||
|
license = GPL-3.0-or-later
|
||||||
|
makedepends = git
|
||||||
|
makedepends = cmake
|
||||||
|
makedepends = ninja
|
||||||
|
makedepends = extra-cmake-modules
|
||||||
|
depends = qt6-base
|
||||||
|
depends = qt6-declarative
|
||||||
|
depends = kirigami
|
||||||
|
depends = ki18n
|
||||||
|
depends = kcoreaddons
|
||||||
|
depends = kcrash
|
||||||
|
depends = kconfig
|
||||||
|
depends = mpvqt
|
||||||
|
depends = qcoro
|
||||||
|
depends = qtkeychain-qt6
|
||||||
|
depends = ffmpeg
|
||||||
|
depends = hicolor-icon-theme
|
||||||
|
optdepends = qqc2-desktop-style: Plasma look for the interface
|
||||||
|
optdepends = plasma-integration: Plasma file dialogs, colours and icons
|
||||||
|
provides = qtpotato=0.1.0
|
||||||
|
conflicts = qtpotato
|
||||||
|
source = qtpotato::git+https://git.trivk.dev/tri/QtPotato.git
|
||||||
|
sha256sums = SKIP
|
||||||
|
|
||||||
|
pkgname = qtpotato-git
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# Maintainer: Tri Vo Khac
|
||||||
|
|
||||||
|
pkgname=qtpotato-git
|
||||||
|
_pkgname=qtpotato
|
||||||
|
pkgver=0.1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='KDE video player built on mpv that translates subtitles with an LLM (development version)'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.trivk.dev/tri/QtPotato'
|
||||||
|
license=('GPL-3.0-or-later')
|
||||||
|
depends=('qt6-base' 'qt6-declarative' 'kirigami' 'ki18n' 'kcoreaddons' 'kcrash' 'kconfig'
|
||||||
|
'mpvqt' 'qcoro' 'qtkeychain-qt6' 'ffmpeg' 'hicolor-icon-theme')
|
||||||
|
makedepends=('git' 'cmake' 'ninja' 'extra-cmake-modules')
|
||||||
|
optdepends=('qqc2-desktop-style: Plasma look for the interface'
|
||||||
|
'plasma-integration: Plasma file dialogs, colours and icons')
|
||||||
|
provides=("$_pkgname=$pkgver")
|
||||||
|
conflicts=("$_pkgname")
|
||||||
|
source=("$_pkgname::git+$url.git")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd "$_pkgname"
|
||||||
|
if git describe --tags --long >/dev/null 2>&1; then
|
||||||
|
git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
||||||
|
else
|
||||||
|
printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cmake -B build -S "$_pkgname" -G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=None \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-DBUILD_TESTING=ON
|
||||||
|
cmake --build build
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
DESTDIR="$pkgdir" cmake --install build
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
pkgbase = qtpotato
|
||||||
|
pkgdesc = KDE video player built on mpv that translates subtitles with an LLM
|
||||||
|
pkgver = 0.1.0
|
||||||
|
pkgrel = 1
|
||||||
|
url = https://git.trivk.dev/tri/QtPotato
|
||||||
|
arch = x86_64
|
||||||
|
license = GPL-3.0-or-later
|
||||||
|
makedepends = cmake
|
||||||
|
makedepends = ninja
|
||||||
|
makedepends = extra-cmake-modules
|
||||||
|
depends = qt6-base
|
||||||
|
depends = qt6-declarative
|
||||||
|
depends = kirigami
|
||||||
|
depends = ki18n
|
||||||
|
depends = kcoreaddons
|
||||||
|
depends = kcrash
|
||||||
|
depends = kconfig
|
||||||
|
depends = mpvqt
|
||||||
|
depends = qcoro
|
||||||
|
depends = qtkeychain-qt6
|
||||||
|
depends = ffmpeg
|
||||||
|
depends = hicolor-icon-theme
|
||||||
|
optdepends = qqc2-desktop-style: Plasma look for the interface
|
||||||
|
optdepends = plasma-integration: Plasma file dialogs, colours and icons
|
||||||
|
source = https://git.trivk.dev/tri/QtPotato/releases/download/v0.1.0/qtpotato-0.1.0.tar.gz
|
||||||
|
sha256sums = SKIP
|
||||||
|
|
||||||
|
pkgname = qtpotato
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Maintainer: Tri Vo Khac
|
||||||
|
|
||||||
|
pkgname=qtpotato
|
||||||
|
pkgver=0.1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='KDE video player built on mpv that translates subtitles with an LLM'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.trivk.dev/tri/QtPotato'
|
||||||
|
license=('GPL-3.0-or-later')
|
||||||
|
depends=('qt6-base' 'qt6-declarative' 'kirigami' 'ki18n' 'kcoreaddons' 'kcrash' 'kconfig'
|
||||||
|
'mpvqt' 'qcoro' 'qtkeychain-qt6' 'ffmpeg' 'hicolor-icon-theme')
|
||||||
|
makedepends=('cmake' 'ninja' 'extra-cmake-modules')
|
||||||
|
optdepends=('qqc2-desktop-style: Plasma look for the interface'
|
||||||
|
'plasma-integration: Plasma file dialogs, colours and icons')
|
||||||
|
source=("$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz")
|
||||||
|
# Filled in by update-pkgbuild.sh from the release's SHA256SUMS.
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cmake -B build -S "$pkgname-$pkgver" -G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=None \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-DBUILD_TESTING=ON
|
||||||
|
cmake --build build
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
DESTDIR="$pkgdir" cmake --install build
|
||||||
|
}
|
||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Point the qtpotato PKGBUILD at a published release and regenerate .SRCINFO.
|
||||||
|
#
|
||||||
|
# Usage: packaging/aur/update-pkgbuild.sh <version> (e.g. 0.2.0, after the v0.2.0 release)
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
version="${1#v}"
|
||||||
|
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
url="https://git.trivk.dev/tri/QtPotato/releases/download/v$version"
|
||||||
|
sum="$(curl -fsSL "$url/SHA256SUMS" | awk -v f="qtpotato-$version.tar.gz" '$2 == f { print $1 }')"
|
||||||
|
[[ -n "$sum" ]] || { echo "qtpotato-$version.tar.gz not found in $url/SHA256SUMS" >&2; exit 1; }
|
||||||
|
|
||||||
|
cd "$dir/qtpotato"
|
||||||
|
sed -i -e "s/^pkgver=.*/pkgver=$version/" -e "s/^pkgrel=.*/pkgrel=1/" \
|
||||||
|
-e "s/^sha256sums=.*/sha256sums=('$sum')/" PKGBUILD
|
||||||
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
|
cd "$dir/qtpotato-git"
|
||||||
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
Reference in new issue
Block a user