adding automatic releases to AUR

This commit is contained in:
lone-cloud 2025-08-22 17:00:18 -07:00
parent 19fa2a4a8a
commit 4d071b9836
5 changed files with 202 additions and 20 deletions

155
.github/workflows/aur-release.yml vendored Normal file
View file

@ -0,0 +1,155 @@
name: AUR Release
permissions:
contents: read
actions: read
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag version to release to AUR (e.g., v0.5.1)'
required: true
type: string
workflow_call:
inputs:
tag:
description: 'Tag version to release to AUR'
required: true
type: string
jobs:
aur-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Get release information
id: release_info
run: |
TAG="${{ inputs.tag }}"
VERSION=${TAG#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT
# Get author info from package.json
AUTHOR_NAME=$(node -p "require('./package.json').author.name")
AUTHOR_EMAIL=$(node -p "require('./package.json').author.email")
echo "author_name=$AUTHOR_NAME" >> $GITHUB_OUTPUT
echo "author_email=$AUTHOR_EMAIL" >> $GITHUB_OUTPUT
# Get AppImage download URL from GitHub release
APPIMAGE_URL="https://github.com/lone-cloud/friendly-kobold/releases/download/$TAG/Friendly%20Kobold-$VERSION.AppImage"
echo "appimage_url=$APPIMAGE_URL" >> $GITHUB_OUTPUT
# Download AppImage to calculate SHA256
curl -L -o "friendly-kobold-$VERSION.AppImage" "$APPIMAGE_URL"
SHA256=$(sha256sum "friendly-kobold-$VERSION.AppImage" | cut -d' ' -f1)
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
echo "Release info:"
echo "Version: $VERSION"
echo "Tag: $TAG"
echo "Author: $AUTHOR_NAME <$AUTHOR_EMAIL>"
echo "AppImage URL: $APPIMAGE_URL"
echo "SHA256: $SHA256"
- name: Generate PKGBUILD
run: |
cat > PKGBUILD << 'EOF'
# Maintainer: ${{ steps.release_info.outputs.author_name }} <${{ steps.release_info.outputs.author_email }}>
pkgname=friendly-kobold
pkgver=${{ steps.release_info.outputs.version }}
pkgrel=1
pkgdesc="A modern Electron shell for KoboldCpp"
arch=('x86_64')
url="https://github.com/lone-cloud/friendly-kobold"
license=('AGPL-3.0-or-later')
depends=('gtk3' 'libxss' 'nss' 'alsa-lib')
optdepends=('koboldcpp: AI language model backend')
provides=('friendly-kobold')
conflicts=('friendly-kobold-git')
source=("friendly-kobold-${pkgver}.AppImage::${{ steps.release_info.outputs.appimage_url }}")
sha256sums=('${{ steps.release_info.outputs.sha256 }}')
prepare() {
chmod +x "friendly-kobold-${pkgver}.AppImage"
"./friendly-kobold-${pkgver}.AppImage" --appimage-extract
}
package() {
# Install the application
install -dm755 "${pkgdir}/opt/friendly-kobold"
cp -r squashfs-root/* "${pkgdir}/opt/friendly-kobold/"
# Create executable wrapper
install -dm755 "${pkgdir}/usr/bin"
cat > "${pkgdir}/usr/bin/friendly-kobold" << 'WRAPPER'
#!/bin/bash
exec /opt/friendly-kobold/friendly-kobold "$@"
WRAPPER
chmod +x "${pkgdir}/usr/bin/friendly-kobold"
# Install desktop file
install -dm755 "${pkgdir}/usr/share/applications"
cat > "${pkgdir}/usr/share/applications/friendly-kobold.desktop" << 'DESKTOP'
[Desktop Entry]
Name=Friendly Kobold
Comment=A modern Electron shell for KoboldCpp
Exec=friendly-kobold %U
Terminal=false
Type=Application
Icon=friendly-kobold
Categories=Development;Utility;
StartupWMClass=friendly-kobold
DESKTOP
# Install icon
install -dm755 "${pkgdir}/usr/share/pixmaps"
if [ -f "${pkgdir}/opt/friendly-kobold/resources/assets/icon.png" ]; then
cp "${pkgdir}/opt/friendly-kobold/resources/assets/icon.png" "${pkgdir}/usr/share/pixmaps/friendly-kobold.png"
fi
}
EOF
- name: Validate PKGBUILD
run: |
# Install tools needed for validation
sudo pacman -Sy --noconfirm namcap
# Check PKGBUILD syntax
makepkg --printsrcinfo > .SRCINFO
namcap PKGBUILD || true
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
with:
pkgname: friendly-kobold
pkgbuild: ./PKGBUILD
commit_username: ${{ steps.release_info.outputs.author_name }}
commit_email: ${{ steps.release_info.outputs.author_email }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: 'Update to ${{ steps.release_info.outputs.version }}'
ssh_keyscan_types: rsa,ecdsa,ed25519
- name: Create AUR release summary
run: |
echo "## AUR Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📦 **Package**: friendly-kobold" >> $GITHUB_STEP_SUMMARY
echo "🔖 **Version**: ${{ steps.release_info.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "🔗 **AUR Page**: https://aur.archlinux.org/packages/friendly-kobold" >> $GITHUB_STEP_SUMMARY
echo "✅ **Status**: Successfully published to AUR" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Installation" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "# Using yay" >> $GITHUB_STEP_SUMMARY
echo "yay -S friendly-kobold" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Using paru" >> $GITHUB_STEP_SUMMARY
echo "paru -S friendly-kobold" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

View file

@ -14,13 +14,20 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Get Node.js version from package.json
id: versions
run: |
NODE_VERSION=$(node -p "require('./package.json').volta.node")
echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT
echo "📦 Using Node.js $NODE_VERSION from package.json"
- name: Enable Corepack - name: Enable Corepack
run: corepack enable run: corepack enable
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '22' node-version: ${{ steps.versions.outputs.node-version }}
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - name: Install dependencies

View file

@ -27,11 +27,21 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Get Node.js and Yarn versions from package.json
id: versions
run: |
# Use system node to read package.json (GitHub runners have Node.js pre-installed)
NODE_VERSION=$(node -p "require('./package.json').volta.node")
YARN_VERSION=$(node -p "require('./package.json').volta.yarn")
echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT
echo "yarn-version=$YARN_VERSION" >> $GITHUB_OUTPUT
echo "📦 Using Node.js $NODE_VERSION and Yarn $YARN_VERSION from package.json"
- name: Setup Node.js with Volta - name: Setup Node.js with Volta
uses: volta-cli/action@v4 uses: volta-cli/action@v4
with: with:
node-version: '22.18.0' node-version: ${{ steps.versions.outputs.node-version }}
yarn-version: '4.9.2' yarn-version: ${{ steps.versions.outputs.yarn-version }}
- name: Install dependencies - name: Install dependencies
run: yarn run: yarn
@ -141,3 +151,10 @@ jobs:
done done
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
aur-release:
needs: release
uses: ./.github/workflows/aur-release.yml
with:
tag: ${{ github.ref_name }}
secrets: inherit

View file

@ -1,7 +1,7 @@
{ {
"name": "friendly-kobold", "name": "friendly-kobold",
"productName": "Friendly Kobold", "productName": "Friendly Kobold",
"version": "0.5.1", "version": "0.5.2",
"description": "A modern Electron shell for KoboldCpp", "description": "A modern Electron shell for KoboldCpp",
"main": "out/main/index.js", "main": "out/main/index.js",
"homepage": "./", "homepage": "./",
@ -11,9 +11,9 @@
}, },
"volta": { "volta": {
"node": "22.18.0", "node": "22.18.0",
"yarn": "4.9.2" "yarn": "4.9.3"
}, },
"packageManager": "yarn@4.9.2", "packageManager": "yarn@4.9.3",
"scripts": { "scripts": {
"dev": "electron-vite dev", "dev": "electron-vite dev",
"build": "electron-vite build", "build": "electron-vite build",
@ -46,11 +46,14 @@
"ai", "ai",
"llm" "llm"
], ],
"author": "lone-cloud", "author": {
"name": "lone-cloud",
"email": "hoboman313@proton.me"
},
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"devDependencies": { "devDependencies": {
"@cspell/eslint-plugin": "^9.2.0", "@cspell/eslint-plugin": "^9.2.0",
"@eslint/js": "^9.33.0", "@eslint/js": "^9.34.0",
"@types/node": "^24.3.0", "@types/node": "^24.3.0",
"@types/react": "^19.1.11", "@types/react": "^19.1.11",
"@types/react-dom": "^19.1.7", "@types/react-dom": "^19.1.7",
@ -62,7 +65,7 @@
"electron": "^37.3.1", "electron": "^37.3.1",
"electron-builder": "^26.0.12", "electron-builder": "^26.0.12",
"electron-vite": "^4.0.0", "electron-vite": "^4.0.0",
"eslint": "^9.33.0", "eslint": "^9.34.0",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-no-comments": "^1.1.10", "eslint-plugin-no-comments": "^1.1.10",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",

View file

@ -1221,10 +1221,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@eslint/js@npm:9.33.0, @eslint/js@npm:^9.33.0": "@eslint/js@npm:9.34.0, @eslint/js@npm:^9.34.0":
version: 9.33.0 version: 9.34.0
resolution: "@eslint/js@npm:9.33.0" resolution: "@eslint/js@npm:9.34.0"
checksum: 10c0/4c42c9abde76a183b8e47205fd6c3116b058f82f07b6ad4de40de56cdb30a36e9ecd40efbea1b63a84d08c206aadbb0aa39a890197e1ad6455a8e542df98f186 checksum: 10c0/53f1bfd2a374683d9382a6850354555f6e89a88416c34a5d34e9fbbaf717e97c2b06300e8f93e5eddba8bda8951ccab7f93a680e56ded1a3d21d526019e69bab
languageName: node languageName: node
linkType: hard linkType: hard
@ -4038,9 +4038,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"eslint@npm:^9.33.0": "eslint@npm:^9.34.0":
version: 9.33.0 version: 9.34.0
resolution: "eslint@npm:9.33.0" resolution: "eslint@npm:9.34.0"
dependencies: dependencies:
"@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/eslint-utils": "npm:^4.2.0"
"@eslint-community/regexpp": "npm:^4.12.1" "@eslint-community/regexpp": "npm:^4.12.1"
@ -4048,7 +4048,7 @@ __metadata:
"@eslint/config-helpers": "npm:^0.3.1" "@eslint/config-helpers": "npm:^0.3.1"
"@eslint/core": "npm:^0.15.2" "@eslint/core": "npm:^0.15.2"
"@eslint/eslintrc": "npm:^3.3.1" "@eslint/eslintrc": "npm:^3.3.1"
"@eslint/js": "npm:9.33.0" "@eslint/js": "npm:9.34.0"
"@eslint/plugin-kit": "npm:^0.3.5" "@eslint/plugin-kit": "npm:^0.3.5"
"@humanfs/node": "npm:^0.16.6" "@humanfs/node": "npm:^0.16.6"
"@humanwhocodes/module-importer": "npm:^1.0.1" "@humanwhocodes/module-importer": "npm:^1.0.1"
@ -4084,7 +4084,7 @@ __metadata:
optional: true optional: true
bin: bin:
eslint: bin/eslint.js eslint: bin/eslint.js
checksum: 10c0/1e1f60d2b62d9d65553e9af916a8dccf00eeedd982103f35bf58c205803907cb1fda73ef595178d47384ea80d8624a182b63682a6b15d8387e9a5d86904a2a2d checksum: 10c0/ba3e54fa0c8ed23d062f91519afaae77fed922a6c4d76130b6cd32154bcb406aaea4b3c5ed88e0be40828c1d5b6921592f3947dbdc5e2043de6bd7aa341fe5ea
languageName: node languageName: node
linkType: hard linkType: hard
@ -4400,7 +4400,7 @@ __metadata:
resolution: "friendly-kobold@workspace:." resolution: "friendly-kobold@workspace:."
dependencies: dependencies:
"@cspell/eslint-plugin": "npm:^9.2.0" "@cspell/eslint-plugin": "npm:^9.2.0"
"@eslint/js": "npm:^9.33.0" "@eslint/js": "npm:^9.34.0"
"@mantine/core": "npm:^8.2.7" "@mantine/core": "npm:^8.2.7"
"@mantine/hooks": "npm:^8.2.7" "@mantine/hooks": "npm:^8.2.7"
"@types/node": "npm:^24.3.0" "@types/node": "npm:^24.3.0"
@ -4415,7 +4415,7 @@ __metadata:
electron: "npm:^37.3.1" electron: "npm:^37.3.1"
electron-builder: "npm:^26.0.12" electron-builder: "npm:^26.0.12"
electron-vite: "npm:^4.0.0" electron-vite: "npm:^4.0.0"
eslint: "npm:^9.33.0" eslint: "npm:^9.34.0"
eslint-plugin-import: "npm:^2.32.0" eslint-plugin-import: "npm:^2.32.0"
eslint-plugin-no-comments: "npm:^1.1.10" eslint-plugin-no-comments: "npm:^1.1.10"
eslint-plugin-react: "npm:^7.37.5" eslint-plugin-react: "npm:^7.37.5"