Skip to content
Merged
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
216 changes: 105 additions & 111 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,151 +5,145 @@ on:
tags:
- "v*"
- "*-beta"
- "*-dev"
workflow_dispatch:

jobs:
# for appimage
build-appimage:
runs-on: ubuntu-latest
build:
name: Build ${{ matrix.format }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
format: appimage
args: "--no-docker"
artifact_name: "-appimage"
- os: ubuntu-latest
format: system
args: ""
artifact_name: "-deb"
- os: ubuntu-latest
format: system
args: ""
container: fedora:40
artifact_name: "-rpm"

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install system dependencies
- name: Install Build Dependencies (Ubuntu)
if: matrix.container == ''
run: |
sudo apt-get update
sudo apt-get install -y \
wget \
binutils \
fuse \
libfuse2 \
libglib2.0-0 \
libgl1 \
libegl1 \
libdbus-1-3 \
ruby-dev\
build-essential\
rpm\
libxcb-cursor0
- name: Build AppImage
build-essential git python3-dev libfuse2 binutils debhelper devscripts \
dosfstools ntfs-3g exfatprogs e2fsprogs udftools btrfs-progs xfsprogs \
libgl1 libqt6dbus6 libqt6gui6 libxcb-cursor0 libxcb-icccm4 libxcb-keysyms1 \
libxcb-shape0 libxkbcommon-x11-0

- name: Install Build Dependencies (Fedora)
if: matrix.container != ''
run: |
chmod +x scripts/build-appimage.sh
bash scripts/build-appimage.sh
dnf install -y python3-pip python3-devel gcc git rpm-build mesa-libGL libxcb \
btrfs-progs dosfstools e2fsprogs exfatprogs hfsplus-tools ntfs-3g qt6-qtbase-gui udftools xfsprogs

- name: Set up Python (AppImage only)
if: matrix.format == 'appimage'
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Verify AppImage
- name: Install Briefcase
run: |
ls -lh Lufus-x86_64.AppImage
file Lufus-x86_64.AppImage
chmod +x Lufus-x86_64.AppImage
python3 -m pip install --upgrade pip
python3 -m pip install briefcase --ignore-installed

- name: Generate checksums
- name: Build Package
run: |
sha256sum Lufus-x86_64.AppImage > Lufus-x86_64.AppImage.sha256
cat Lufus-x86_64.AppImage.sha256
briefcase package linux ${{ matrix.format }} ${{ matrix.args }} --no-input

- name: Create Release
- name: Release Packages
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
with:
tag_name: ${{ github.ref_name }}
files: |
Lufus-x86_64.AppImage
Lufus-x86_64.AppImage.sha256
draft: false
prerelease: ${{ contains(github.ref, '-beta') }}
dist/*.AppImage
dist/*.deb
dist/*.rpm
tag_name: ${{ github.ref_name }}
append_body: true
generate_release_notes: true

# for binary

build-tarball:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
pip install pyinstaller PyQt6 psutil pyudev requests packaging platformdirs requests

- name: Build with PyInstaller
run: |
pyinstaller --noconfirm --onedir --windowed \
--icon "src/lufus/gui/assets/icons/lufuslogo.ico" \
--paths "./src" \
--add-data "src/lufus/gui/assets:lufus/gui/assets" \
--add-data "src/lufus/gui/languages:lufus/gui/languages" \
--add-data "src/lufus/gui/themes:lufus/gui/themes" \
--collect-all PyQt6 \
--name "Lufus-x86_64-${{ github.ref_name }}" \
"src/lufus/__main__.py"

- name: Create Tarball and Checksum
run: |
cd dist
tar -cvzf ../Lufus-x86_64-${{ github.ref_name }}.tar.gz Lufus-x86_64-${{ github.ref_name }}
cd ..
sha256sum Lufus-x86_64-${{ github.ref_name }}.tar.gz > Lufus-x86_64-${{ github.ref_name }}.tar.gz.sha256

- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: |
Lufus-x86_64-${{ github.ref_name }}.tar.gz
Lufus-x86_64-${{ github.ref_name }}.tar.gz.sha256
append_body: true

# for fpm packages
build-fpm:
needs: build-tarball
runs-on: ubuntu-latest
permissions:
permissions:
contents: write
strategy:
matrix:
pkg_type: [deb, rpm]
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: actions/setup-ruby@v1
- name: Set up Python
uses: actions/setup-python@v5
with:
ruby-version: '3.2'

- name: Install FPM
run: gem install fpm
python-version: "3.13"

- name: Download tarball from release
- name: Install dependencies
run: |
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/Lufus-x86_64-${{ github.ref_name }}.tar.gz
pip install pyinstaller PySide6 psutil pyudev requests packaging platformdirs

- name: Build ${{ matrix.pkg_type }} Package
- name: Build with PyInstaller
run: |
pyinstaller --noconfirm --onefile --windowed \
--icon "src/lufus/gui/assets/icons/lufuslogo.ico" \
--paths "./src" \
--add-data "src/lufus/gui/assets:lufus/gui/assets" \
--add-data "src/lufus/gui/languages:lufus/gui/languages" \
--add-data "src/lufus/gui/themes:lufus/gui/themes" \
--hidden-import "PySide6.QtCore" \
--hidden-import "PySide6.QtWidgets" \
--hidden-import "PySide6.QtGui" \
--collect-binaries PySide6 \
--name "Lufus-x86_64-${{ github.ref_name }}" \
"src/lufus/__main__.py"

- name: Create Tarball and Checksum
run: |
mkdir tmp_source && tar -xzf Lufus-x86_64-${{ github.ref_name }}.tar.gz -C tmp_source
fpm -s dir -t ${{ matrix.pkg_type }} \
-n "Lufus" \
-v "${{ github.ref_name }}" \
--iteration 1 \
--prefix /opt/lufus \
--description "Physical drive imaging and formatting utility" \
-C tmp_source/Lufus-x86_64-${{ github.ref_name }} .

- name: Upload to Release
cd dist
tar -cvzf ../Lufus-x86_64-${{ github.ref_name }}.tar.gz Lufus-x86_64-${{ github.ref_name }}
cd ..
sha256sum Lufus-x86_64-${{ github.ref_name }}.tar.gz > Lufus-x86_64-${{ github.ref_name }}.tar.gz.sha256

- name: Release Tarball
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
with:
tag_name: ${{ github.ref_name }}
files: |
*.deb
*.rpm
Lufus-*.tar.gz
Lufus-*.sha256
tag_name: ${{ github.ref_name }}
append_body: true
generate_release_notes: true

# release:
# name: Create Release
# needs: [build, build-tarball]
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# permissions:
# contents: write
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v4
# with:
# path: release-assets
# merge-multiple: true

# - name: Upload to Release
# uses: softprops/action-gh-release@v2
# with:
# files: release-assets/*
# generate_release_notes: true
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "1.0.0" # keep synced with [tool.briefcase] version
description = "A rufus clone written in Python and designed to work with Linux."
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
requires-python = ">=3.10"
dependencies = [
"psutil>=7.2",
Expand All @@ -32,7 +33,8 @@ project_name = "Lufus"
bundle = "com.github.hog185"
version = "1.0.0" # keep synced with [project] version
url = "https://github.com/Hog185/Lufus"
license.file = "LICENSE"
license = "MIT"
license-files = ["LICENSE"]
author = "Hog185"
author_email = "example@example.com"

Expand All @@ -47,6 +49,7 @@ sources = [
test_sources = [
"tests",
]
icon = "src/lufus/gui/assets/icons/lufuslogo"
requires = [
"psutil>=7.2",
"pyside6",
Expand Down Expand Up @@ -136,14 +139,18 @@ system_runtime_requires = [

[tool.briefcase.app.lufus.linux.appimage]
manylinux = "manylinux_2_28"
system_requires = [] # AppImage needs this section present
system_requires = ["libxcb-cursor0", "libgl1",] # AppImage needs this section present
linuxdeploy_plugins = []

[tool.briefcase.app.lufus.linux.flatpak]
flatpak_runtime = "org.kde.Platform"
flatpak_runtime_version = "6.9"
flatpak_sdk = "org.kde.Sdk"

[tool.briefcase.app.lufus.linux.deb]

[tool.briefcase.app.lufus.linux.rpm]

# Unsupported platforms

[tool.briefcase.app.lufus.windows]
Expand Down
Loading