Skip to content

Commit 7284087

Browse files
committed
Add AUR packages
1 parent 40890e0 commit 7284087

6 files changed

Lines changed: 306 additions & 1 deletion

File tree

.github/workflows/android.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,33 @@ jobs:
229229
name: rpm-package
230230
path: desktopApp/build/compose/binaries/main/rpm/*.rpm
231231

232+
linux-tar:
233+
name: Generate Linux Tarball
234+
runs-on: ubuntu-latest
235+
steps:
236+
- name: Checkout
237+
uses: actions/checkout@v4
238+
- name: Setup JDK
239+
uses: actions/setup-java@v4
240+
with:
241+
distribution: temurin
242+
java-version: "17"
243+
- name: Set execution flag for gradlew
244+
run: chmod +x gradlew
245+
- name: Build application distribution
246+
run: ./gradlew :desktopApp:createDistributable --stacktrace
247+
- name: Copy icon into distributable
248+
run: cp desktopApp/icon.png desktopApp/build/compose/binaries/main/app/LinuxCommandLibrary/lib/LinuxCommandLibrary.png
249+
- name: Package tarball
250+
run: |
251+
cd desktopApp/build/compose/binaries/main/app
252+
tar czf "$GITHUB_WORKSPACE/LinuxCommandLibrary-linux-x86_64.tar.gz" LinuxCommandLibrary
253+
- name: Upload Tarball Artifact
254+
uses: actions/upload-artifact@v4
255+
with:
256+
name: linux-tar-package
257+
path: LinuxCommandLibrary-linux-x86_64.tar.gz
258+
232259
appimage:
233260
name: Generate AppImage
234261
runs-on: ubuntu-latest
@@ -352,7 +379,7 @@ jobs:
352379

353380
release:
354381
name: Release All Platforms
355-
needs: [apk, cli-linux, cli-macos, cli-windows, dmg, msi, deb, rpm, appimage]
382+
needs: [apk, cli-linux, cli-macos, cli-windows, dmg, msi, deb, rpm, appimage, linux-tar]
356383
runs-on: ubuntu-latest
357384
steps:
358385
- name: Checkout
@@ -415,6 +442,11 @@ jobs:
415442
with:
416443
name: appimage-package
417444

445+
- name: Download Linux Tarball Artifact
446+
uses: actions/download-artifact@v4
447+
with:
448+
name: linux-tar-package
449+
418450
- name: List downloaded files (for debugging)
419451
run: ls -la
420452

@@ -447,6 +479,7 @@ jobs:
447479
mv *.deb "LinuxCommandLibrary-${VERSION}-linux.deb"
448480
mv *.rpm "LinuxCommandLibrary-${VERSION}-linux.rpm"
449481
mv *.AppImage "LinuxCommandLibrary-${VERSION}-linux.AppImage"
482+
mv LinuxCommandLibrary-linux-x86_64.tar.gz "LinuxCommandLibrary-${VERSION}-linux-x86_64.tar.gz"
450483
451484
- name: Create Github Release
452485
uses: softprops/action-gh-release@v2

.github/workflows/aur.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: AUR Package
2+
3+
on:
4+
push:
5+
paths:
6+
- 'aur/**'
7+
pull_request:
8+
paths:
9+
- 'aur/**'
10+
workflow_run:
11+
workflows: ["Build and Release"]
12+
types: [completed]
13+
14+
jobs:
15+
validate:
16+
name: Validate PKGBUILDs
17+
if: github.event_name != 'workflow_run'
18+
runs-on: ubuntu-latest
19+
container: archlinux:base-devel
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup build user
25+
run: |
26+
useradd -m builder
27+
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
28+
chown -R builder:builder .
29+
30+
- name: Install namcap
31+
run: pacman -Sy --noconfirm namcap
32+
33+
- name: Lint lcl-bin PKGBUILD
34+
working-directory: aur/lcl-bin
35+
run: namcap PKGBUILD
36+
37+
- name: Validate lcl-bin .SRCINFO
38+
working-directory: aur/lcl-bin
39+
run: |
40+
su builder -c "makepkg --printsrcinfo" > .SRCINFO.generated
41+
diff -u .SRCINFO .SRCINFO.generated
42+
43+
- name: Lint lcl-gui-bin PKGBUILD
44+
working-directory: aur/lcl-gui-bin
45+
run: namcap PKGBUILD
46+
47+
- name: Validate lcl-gui-bin .SRCINFO
48+
working-directory: aur/lcl-gui-bin
49+
run: |
50+
su builder -c "makepkg --printsrcinfo" > .SRCINFO.generated
51+
diff -u .SRCINFO .SRCINFO.generated
52+
53+
publish:
54+
name: Publish to AUR
55+
if: github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'
56+
runs-on: ubuntu-latest
57+
container: archlinux:base-devel
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
62+
- name: Setup build user
63+
run: |
64+
useradd -m builder
65+
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
66+
67+
- name: Install dependencies
68+
run: pacman -Sy --noconfirm openssh git
69+
70+
- name: Get version from release
71+
id: version
72+
run: echo "version=$(echo '${{ github.event.workflow_run.head_branch }}' | sed 's/^v//')" >> $GITHUB_OUTPUT
73+
74+
- name: Update PKGBUILDs and checksums
75+
run: |
76+
VERSION="${{ steps.version.outputs.version }}"
77+
78+
# Download CLI zip and compute SHA256
79+
CLI_URL="https://github.com/SimonSchubert/LinuxCommandLibrary/releases/download/v${VERSION}/LinuxCommandLibrary-${VERSION}-cli-linux-x64.zip"
80+
curl -L -o cli.zip "$CLI_URL"
81+
CLI_SHA256=$(sha256sum cli.zip | cut -d' ' -f1)
82+
rm cli.zip
83+
84+
# Download GUI tarball and compute SHA256
85+
GUI_URL="https://github.com/SimonSchubert/LinuxCommandLibrary/releases/download/v${VERSION}/LinuxCommandLibrary-${VERSION}-linux-x86_64.tar.gz"
86+
curl -L -o gui.tar.gz "$GUI_URL"
87+
GUI_SHA256=$(sha256sum gui.tar.gz | cut -d' ' -f1)
88+
rm gui.tar.gz
89+
90+
# Update lcl-bin PKGBUILD
91+
cd aur/lcl-bin
92+
sed -i "s|^pkgver=.*|pkgver=${VERSION}|" PKGBUILD
93+
sed -i "s|^pkgrel=.*|pkgrel=1|" PKGBUILD
94+
sed -i "s|^sha256sums=.*|sha256sums=('${CLI_SHA256}')|" PKGBUILD
95+
chown -R builder:builder .
96+
su builder -c "makepkg --printsrcinfo" > .SRCINFO
97+
echo "=== lcl-bin PKGBUILD ==="
98+
cat PKGBUILD
99+
100+
# Update lcl-gui-bin PKGBUILD
101+
cd ../lcl-gui-bin
102+
sed -i "s|^pkgver=.*|pkgver=${VERSION}|" PKGBUILD
103+
sed -i "s|^pkgrel=.*|pkgrel=1|" PKGBUILD
104+
sed -i "s|^sha256sums=.*|sha256sums=('${GUI_SHA256}')|" PKGBUILD
105+
chown -R builder:builder .
106+
su builder -c "makepkg --printsrcinfo" > .SRCINFO
107+
echo "=== lcl-gui-bin PKGBUILD ==="
108+
cat PKGBUILD
109+
110+
- name: Push to AUR
111+
env:
112+
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
113+
run: |
114+
# Setup SSH - use system-wide known_hosts to avoid HOME mismatch in containers
115+
echo "aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN" >> /etc/ssh/ssh_known_hosts
116+
for dir in "$HOME" "/root"; do
117+
mkdir -p "$dir/.ssh"
118+
echo "$AUR_SSH_KEY" > "$dir/.ssh/aur"
119+
chmod 600 "$dir/.ssh/aur"
120+
printf "Host aur.archlinux.org\n IdentityFile %s/.ssh/aur\n User aur\n" "$dir" > "$dir/.ssh/config"
121+
chmod 700 "$dir/.ssh"
122+
chmod 600 "$dir/.ssh/config"
123+
done
124+
125+
git config --global user.name "Simon Schubert"
126+
git config --global user.email "sschubert89@gmail.com"
127+
128+
VERSION="${{ steps.version.outputs.version }}"
129+
130+
# Push lcl-bin
131+
cd /tmp
132+
git clone ssh://aur@aur.archlinux.org/lcl-bin.git
133+
cp $GITHUB_WORKSPACE/aur/lcl-bin/PKGBUILD lcl-bin/
134+
cp $GITHUB_WORKSPACE/aur/lcl-bin/.SRCINFO lcl-bin/
135+
cd lcl-bin
136+
git add PKGBUILD .SRCINFO
137+
git commit -m "Update to ${VERSION}"
138+
git push
139+
140+
# Push lcl-gui-bin
141+
cd /tmp
142+
git clone ssh://aur@aur.archlinux.org/lcl-gui-bin.git
143+
cp $GITHUB_WORKSPACE/aur/lcl-gui-bin/PKGBUILD lcl-gui-bin/
144+
cp $GITHUB_WORKSPACE/aur/lcl-gui-bin/.SRCINFO lcl-gui-bin/
145+
cd lcl-gui-bin
146+
git add PKGBUILD .SRCINFO
147+
git commit -m "Update to ${VERSION}"
148+
git push
149+
150+
- name: Update repo PKGBUILDs
151+
env:
152+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
run: |
154+
VERSION="${{ steps.version.outputs.version }}"
155+
156+
cd /tmp
157+
git clone --depth 1 https://x-access-token:${GITHUB_TOKEN}@github.com/SimonSchubert/LinuxCommandLibrary.git lcl-repo
158+
cd lcl-repo
159+
160+
git config user.name "github-actions[bot]"
161+
git config user.email "github-actions[bot]@users.noreply.github.com"
162+
163+
cp $GITHUB_WORKSPACE/aur/lcl-bin/PKGBUILD aur/lcl-bin/PKGBUILD
164+
cp $GITHUB_WORKSPACE/aur/lcl-bin/.SRCINFO aur/lcl-bin/.SRCINFO
165+
cp $GITHUB_WORKSPACE/aur/lcl-gui-bin/PKGBUILD aur/lcl-gui-bin/PKGBUILD
166+
cp $GITHUB_WORKSPACE/aur/lcl-gui-bin/.SRCINFO aur/lcl-gui-bin/.SRCINFO
167+
168+
git add aur/
169+
git commit -m "Update AUR packages to ${VERSION}" || exit 0
170+
git push

aur/lcl-bin/.SRCINFO

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pkgbase = lcl-bin
2+
pkgdesc = Linux command reference and cheat sheets for your terminal
3+
pkgver = 3.6.1
4+
pkgrel = 1
5+
url = https://github.com/SimonSchubert/LinuxCommandLibrary
6+
arch = x86_64
7+
license = Apache-2.0
8+
makedepends = unzip
9+
provides = lcl
10+
conflicts = lcl
11+
source = LinuxCommandLibrary-3.6.1-cli-linux-x64.zip::https://github.com/SimonSchubert/LinuxCommandLibrary/releases/download/v3.6.1/LinuxCommandLibrary-3.6.1-cli-linux-x64.zip
12+
sha256sums = SKIP
13+
14+
pkgname = lcl-bin

aur/lcl-bin/PKGBUILD

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Maintainer: Simon Schubert <sschubert89@gmail.com>
2+
# https://github.com/SimonSchubert/LinuxCommandLibrary
3+
4+
pkgname=lcl-bin
5+
pkgver=3.6.1
6+
pkgrel=1
7+
pkgdesc='Linux command reference and cheat sheets for your terminal'
8+
arch=('x86_64')
9+
url='https://github.com/SimonSchubert/LinuxCommandLibrary'
10+
license=('Apache-2.0')
11+
makedepends=('unzip')
12+
provides=('lcl')
13+
conflicts=('lcl')
14+
15+
source=("LinuxCommandLibrary-${pkgver}-cli-linux-x64.zip::https://github.com/SimonSchubert/LinuxCommandLibrary/releases/download/v${pkgver}/LinuxCommandLibrary-${pkgver}-cli-linux-x64.zip")
16+
sha256sums=('SKIP')
17+
18+
package() {
19+
install -Dm755 "${srcdir}/lcl" "${pkgdir}/usr/bin/lcl"
20+
}

aur/lcl-gui-bin/.SRCINFO

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
pkgbase = lcl-gui-bin
2+
pkgdesc = Linux command reference and cheat sheets - desktop application
3+
pkgver = 3.6.1
4+
pkgrel = 1
5+
url = https://github.com/SimonSchubert/LinuxCommandLibrary
6+
arch = x86_64
7+
license = Apache-2.0
8+
depends = hicolor-icon-theme
9+
provides = lcl-gui
10+
conflicts = lcl-gui
11+
options = !strip
12+
source = LinuxCommandLibrary-3.6.1-linux-x86_64.tar.gz::https://github.com/SimonSchubert/LinuxCommandLibrary/releases/download/v3.6.1/LinuxCommandLibrary-3.6.1-linux-x86_64.tar.gz
13+
sha256sums = SKIP
14+
15+
pkgname = lcl-gui-bin

aur/lcl-gui-bin/PKGBUILD

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Maintainer: Simon Schubert <sschubert89@gmail.com>
2+
# https://github.com/SimonSchubert/LinuxCommandLibrary
3+
4+
pkgname=lcl-gui-bin
5+
pkgver=3.6.1
6+
pkgrel=1
7+
pkgdesc='Linux command reference and cheat sheets - desktop application'
8+
arch=('x86_64')
9+
url='https://github.com/SimonSchubert/LinuxCommandLibrary'
10+
license=('Apache-2.0')
11+
depends=('hicolor-icon-theme')
12+
provides=('lcl-gui')
13+
conflicts=('lcl-gui')
14+
options=('!strip')
15+
16+
source=("LinuxCommandLibrary-${pkgver}-linux-x86_64.tar.gz::https://github.com/SimonSchubert/LinuxCommandLibrary/releases/download/v${pkgver}/LinuxCommandLibrary-${pkgver}-linux-x86_64.tar.gz")
17+
sha256sums=('SKIP')
18+
19+
package() {
20+
# Install application files
21+
install -dm755 "${pkgdir}/opt/lcl-gui"
22+
cp -r "${srcdir}/LinuxCommandLibrary/"* "${pkgdir}/opt/lcl-gui/"
23+
chmod -R go-w "${pkgdir}/opt/lcl-gui"
24+
25+
# Install wrapper script
26+
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/lcl-gui" << 'EOF'
27+
#!/bin/sh
28+
exec /opt/lcl-gui/bin/LinuxCommandLibrary "$@"
29+
EOF
30+
31+
# Install desktop entry
32+
install -Dm644 /dev/stdin "${pkgdir}/usr/share/applications/lcl-gui.desktop" << EOF
33+
[Desktop Entry]
34+
Name=Linux Command Library
35+
Comment=Linux command reference and cheat sheets
36+
Exec=lcl-gui
37+
Icon=lcl-gui
38+
Type=Application
39+
Categories=Utility;
40+
Keywords=Linux;Command;Terminal;Reference;
41+
StartupWMClass=compose-window
42+
Terminal=false
43+
EOF
44+
45+
# Install icon
46+
install -Dm644 "${srcdir}/LinuxCommandLibrary/lib/LinuxCommandLibrary.png" \
47+
"${pkgdir}/usr/share/icons/hicolor/256x256/apps/lcl-gui.png" 2>/dev/null || \
48+
install -Dm644 /dev/null "${pkgdir}/usr/share/icons/hicolor/256x256/apps/lcl-gui.png"
49+
50+
# Install license
51+
install -Dm644 "${srcdir}/LinuxCommandLibrary/lib/LinuxCommandLibrary.copyright" \
52+
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" 2>/dev/null || true
53+
}

0 commit comments

Comments
 (0)