Skip to content
Closed
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
79 changes: 25 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python CI/CD Pipeline (Linter + Debian Build)
name: Python CI/CD Pipeline (Arch Linux Build)

on:
push:
Expand All @@ -12,79 +12,50 @@ jobs:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
container:
image: archlinux:latest

steps:
- name: Checkout Source Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0

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

- name: Install Python Dependencies
run: pip install ruff setuptools

- name: Run Ruff Static Analysis
run: ruff check src/unidesk/

- name: Install Native Build Tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential debhelper dh-python python3-all python3-setuptools

- name: Scaffold Debian Control Files
run: |
mkdir -p debian
mkdir -p debian/source

# Marks as native so Launchpad doesn't crash asking for an original tarball
echo "3.0 (native)" > debian/source/format

cat << 'EOF' > debian/rules
#!/usr/bin/make -f
%:
dh $@ --with python3 --buildsystem=pybuild
EOF
chmod +x debian/rules

cat << 'EOF' > debian/control
Source: unidesk
Section: python
Priority: optional
Maintainer: Apostolos Chalis <achalis@csd.auth.gr>
Build-Depends: debhelper-compat (= 13), dh-python, python3-all, python3-setuptools
Standards-Version: 4.6.2

Package: python3-unidesk
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-pyqt6
Description: Helper app for UniOS written in python/Qt
EOF

DEB_DATE=$(date -R)
DEB_AUTHOR=$(git log -1 --pretty=format:'%an <%ae>')

printf "unidesk (1.0.0) noble; urgency=low\n\n * Auto-generated release.\n\n -- %s %s\n" "$DEB_AUTHOR" "$DEB_DATE" > debian/changelog
pacman -Syyu --noconfirm
pacman -S --noconfirm base-devel python python-pyqt6 python-setuptools python-build python-installer python-wheel ruff

useradd --create-home --shell /bin/bash builder
chown -R builder:builder "$GITHUB_WORKSPACE"

- name: Run Ruff Static Analysis
run: ruff check src/unidesk/

- name: Build Debian Packages (Binary & Source)

- name: Build Arch Packages
run: |
dpkg-buildpackage -us -uc -b

dpkg-buildpackage -us -uc -S

mkdir -p output_package
mv ../unidesk_* output_package/
chown builder:builder output_package

runuser -u builder -- makepkg --noconfirm
mv ./*.pkg.tar.zst output_package/

- name: Upload All Package Artifacts
uses: actions/upload-artifact@v4
with:
name: unidesk-complete-packages
path: output_package/*

- name: Publish .deb to GitHub Releases
uses: softprops/action-gh-release@v2
- name: Publish . to GitHub Releases
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/') # Only runs if you push a tag like v1.0.0
with:
files: output_package/*.deb
files: output_package/*.pkg.tar.zst
Loading