Skip to content

Added workflow for AUR, DEB, and RPM packages #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Build AUR, DEB, and RPM Packages

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential devscripts rpm desktop-file-utils

- name: Prepare version
id: read_version_file
run: echo "version=$(cat src/ver)" >> $GITHUB_OUTPUT

- name: Build AUR package
run: |
docker run --rm -v "$PWD:/workspace" -w /workspace archlinux:base-devel \
bash -c "
pacman -Syu --noconfirm &&
pacman -S --needed --noconfirm base-devel wget libnewt alacritty git &&
useradd -m builder &&
chown -R builder . &&
su builder -c 'cd src/buildfiles/pkgbuild && makepkg -s --noconfirm' &&
cp src/buildfiles/pkgbuild/*.pkg.tar.* ./
"
sudo chown -R $(id -u):$(id -g) .

- name: Get AUR package
id: aur_package_path
run: |
FILE=$(ls linuxtoys-*-x86_64.pkg.tar.* | head -n1)
echo "file=$FILE" >> $GITHUB_OUTPUT

- name: Build DEB package
env:
LINUXTOYS_VERSION: ${{ steps.read_version_file.outputs.version }}
run: |
mkdir -p src/buildfiles/deb/linuxtoys/DEBIAN/opt/linuxtoys
mkdir -p src/buildfiles/deb/linuxtoys/DEBIAN/usr/share/applications
cp src/{linuxtoys.sh,linuxtoys.png} src/buildfiles/deb/linuxtoys/DEBIAN/opt/linuxtoys
cp src/LinuxToys.desktop src/buildfiles/deb/linuxtoys/DEBIAN/usr/share/applications
dpkg-deb --build --root-owner-group src/buildfiles/deb/linuxtoys/
cp src/buildfiles/deb/*.deb ./linuxtoys-${LINUXTOYS_VERSION}-1_amd64.deb

- name: Get DEB package
id: deb_package_path
run: |
FILE=$(ls *.deb | head -n1)
echo "file=$FILE" >> $GITHUB_OUTPUT

- name: Build RPM package
env:
LINUXTOYS_VERSION: ${{ steps.read_version_file.outputs.version }}
run: |
mkdir -p src/buildfiles/rpm/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
mkdir -p src/buildfiles/rpm/linuxtoys-${LINUXTOYS_VERSION}/{opt/linuxtoys,usr/share/applications}
cp src/{linuxtoys.sh,linuxtoys.png} src/buildfiles/rpm/linuxtoys-${LINUXTOYS_VERSION}/opt/linuxtoys
cp src/LinuxToys.desktop src/buildfiles/rpm/linuxtoys-${LINUXTOYS_VERSION}/usr/share/applications
pushd src/buildfiles/rpm/
tar -cJf rpmbuild/SOURCES/linuxtoys-${LINUXTOYS_VERSION}.tar.xz linuxtoys-${LINUXTOYS_VERSION}/
pushd rpmbuild
rpmbuild --define "_topdir `pwd`" -bb SPECS/linuxtoys.spec
popd
popd
cp src/buildfiles/rpm/rpmbuild/RPMS/x86_64/*.rpm ./linuxtoys-${LINUXTOYS_VERSION}-1_amd64.rpm

- name: Get RPM package
id: rpm_package_path
run: |
FILE=$(ls *.rpm | head -n1)
echo "file=$FILE" >> $GITHUB_OUTPUT

- name: Upload AUR package
uses: actions/upload-artifact@v4
with:
name: ${{ steps.aur_package_path.outputs.file }}
path: ${{ steps.aur_package_path.outputs.file }}

- name: Upload DEB package
uses: actions/upload-artifact@v4
with:
name: ${{ steps.deb_package_path.outputs.file }}
path: ${{ steps.deb_package_path.outputs.file }}

- name: Upload RPM package
uses: actions/upload-artifact@v4
with:
name: ${{ steps.rpm_package_path.outputs.file }}
path: ${{ steps.rpm_package_path.outputs.file }}

18 changes: 12 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
*.changes
*.upload
*.dsc
src/buildfiles/deb/linuxtoys-*/debian/.debhelper
*.substvars
debhelper-build-stamp
src/buildfiles/deb/linuxtoys-*/debian/linuxtoys

src/buildfiles/deb/linuxtoys/DEBIAN/opt
src/buildfiles/deb/linuxtoys/DEBIAN/usr
src/buildfiles/deb/linuxtoys/DEBIAN/.debhelper
src/buildfiles/deb/linuxtoys/DEBIAN/linuxtoys
src/buildfiles/deb/*.deb

src/buildfiles/rpm/rpmbuild/x86_64/linuxtoys*
src/buildfiles/deb/linuxtoys-*/debian/opt/linuxtoys/*
src/buildfiles/rpm/linuxtoys-*/x86_64/linuxtoys*
src/buildfiles/rpm/rpmbuild/BUILD/
src/buildfiles/rpm/rpmbuild/SOURCES/
src/buildfiles/rpm/linuxtoys-*/

src/buildfiles/pkgbuild/linuxtoys-*/bin/*
src/buildfiles/rpm/linuxtoys-*/linuxtoys.sh
src/buildfiles/rpm/linuxtoys-*/linuxtoys.png
src/buildfiles/pkgbuild/pkg
src/buildfiles/pkgbuild/src

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Standards-Version: 4.7.2
Homepage: https://github.com/psygreg/linuxtoys
#Vcs-Browser: https://salsa.debian.org/debian/linuxtoys
#Vcs-Git: https://salsa.debian.org/debian/linuxtoys.git

Package: linuxtoys
Version: 2.1.4
Architecture: amd64
Depends: bash, git, curl, wget, whiptail, alacritty
Description: A set of tools for Linux presented in a user-friendly way.
Expand Down
File renamed without changes.
Binary file not shown.
Binary file removed src/buildfiles/deb/linuxtoys_2.1.4.orig.tar.xz
Binary file not shown.
Binary file removed src/buildfiles/rpm/linuxtoys-2.1.4.tar.xz
Binary file not shown.
9 changes: 0 additions & 9 deletions src/buildfiles/rpm/linuxtoys-2.1.4/LinuxToys.desktop

This file was deleted.

15 changes: 7 additions & 8 deletions src/buildfiles/rpm/rpmbuild/SPECS/linuxtoys.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ A menu with various handy tools for Linux gaming, optimization and other tweaks.
%setup -q

%install
mkdir -p %{buildroot}/usr/bin
install -m 755 linuxtoys.sh %{buildroot}/usr/bin/
mkdir -p %{buildroot}/opt/linuxtoys
install -m 755 opt/linuxtoys/linuxtoys.sh %{buildroot}/opt/linuxtoys
install -m 644 opt/linuxtoys/linuxtoys.png %{buildroot}/opt/linuxtoys
mkdir -p %{buildroot}/usr/share/applications
desktop-file-install --dir=%{buildroot}/usr/share/applications LinuxToys.desktop
mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable/apps
install -m 644 linuxtoys.png %{buildroot}/usr/share/icons/hicolor/scalable/apps/
desktop-file-install --dir=%{buildroot}/usr/share/applications usr/share/applications/LinuxToys.desktop

%post
alias_name="linuxtoys"
Expand All @@ -40,10 +39,10 @@ rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root, -)
/usr/bin/linuxtoys.sh
/opt/linuxtoys/linuxtoys.sh
/opt/linuxtoys/linuxtoys.png
/usr/share/applications/LinuxToys.desktop
/usr/share/icons/hicolor/scalable/apps/linuxtoys.png

%changelog
* Thu Jun 5 2025 Victor Gregory <[email protected]> - 2.1.4
- bugfix: now updater works as intended
- bugfix: now updater works as intended