Skip to content

Commit

Permalink
Merge pull request #33 from miguelbaldi/linux-native-packaging
Browse files Browse the repository at this point in the history
Linux native packaging.
  • Loading branch information
miguelbaldi authored Oct 28, 2024
2 parents 43ab45f + 9a2f2ac commit 47128ab
Show file tree
Hide file tree
Showing 55 changed files with 1,178 additions and 59 deletions.
36 changes: 30 additions & 6 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
build-linux-appimage-rpm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,10 +18,32 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: executables-linux
name: executables-linux-appimage-rpm
if-no-files-found: error
path: |
target/appimage/*.AppImage
target/generate-rpm/*.rpm
build-linux-deb:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Fix tag reference (workaround for https://github.com/actions/checkout/issues/290)
run: git fetch --update-head-ok -f origin ${{ github.ref }}:${{ github.ref }}
- name: Install system dependencies
run: |
sudo apt-get install -y pkg-config libgtk-4-dev libadwaita-1-dev libsasl2-dev libgtksourceview-5-dev openssl
cargo install cargo-deb
- name: Build
run: |
cargo deb --deb-version $(git describe)
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: executables-linux-deb
if-no-files-found: error
path: |
target/debian/*.deb
build-windows:
runs-on: ubuntu-latest
steps:
Expand All @@ -31,21 +53,21 @@ jobs:
- name: Build (Windows)
run: docker compose -f docker-compose.windows.yml up
- name: Make Windows Installer
run: ./create_windows_installer.sh
run: ./build-scripts/create_windows_installer.sh
- name: Zip Portable Windows Artifact
run: zip -r windows-portable.zip package
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: executables-windows
path: |
*.zip
windows-portable.zip
*.exe
publish:
permissions:
contents: write
needs: [build, build-windows]
needs: [build-linux-appimage-rpm, build-linux-deb, build-windows]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand All @@ -58,11 +80,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: false
draft: true
draft: true
generate_release_notes: true
append_body: true
files: |
**/*.AppImage
**/*.zip
**/*.exe
**/*.deb
**/*.rpm
- run: ls -R .
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ krust-setup.exe
libs/
package.zip
*.log
LICENSE-win.md
LICENSE
*.bak
63 changes: 63 additions & 0 deletions .licensure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Regexes which if matched by a file path will always be excluded from
# getting a license header
excludes:
- \.gitignore
- .*lock
- \.github/.*
- \.vscode/.*
- \.cargo/.*
- \.git/.*
- \.rpm/.*
- \.licensure\.yml
- \.editorconfig
- README.*
- LICENSE.*
- COPYING
- gtksourceview-5
- package
- target
- libs
- docker-*.yml
- data
- setup.iss
- .*\.(md|rst|txt|iss|desktop|svg|toml)
change_in_place: true

licenses:
- files: any
ident: GPL-3.0
unwrap_text: false
authors:
- name: Miguel A. Baldi Hörlle
email: miguel.horlle@gmail.com
template: |
Copyright (c) [year], [name of author]. All rights reserved. Use of
this source code is governed by the [ident] license that can be
found in the COPYING file.
# Define type of comment characters to apply based on file extensions.
comments:
# The extensions (or singular extension) field defines which file
# extensions to apply the commenter to.
- extensions:
- rs
commenter:
type: line
comment_char: "//"
trailing_lines: 1
- extensions:
- css
- cpp
- c
- less
commenter:
type: block
start_block_char: "/*\n"
end_block_char: "*/"
per_line_char: "*"
trailing_lines: 1
- extension: any
commenter:
type: line
comment_char: "#"
trailing_lines: 1
49 changes: 49 additions & 0 deletions .rpm/krust.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
%define __spec_install_post %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define debug_package %{nil}

Name: krust
Summary: Kafka desktop client
Version: @@VERSION@@
Release: @@RELEASE@@%{?dist}
License: GPL-3.0-or-later
Group: Development/Tools
Source0: %{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

Requires: gtksourceview5
Requires: libadwaita
Requires: cyrus-sasl-devel
Requires: openssl-devel

%description
%{summary}

%prep
%setup -q

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
cp -a * %{buildroot}
mkdir -p %{buildroot}/usr/share/applications
mkdir -p %{buildroot}/usr/share/pixmaps
cp -a ../../../../../data/images/io.miguelbaldi.KRust* %{buildroot}/usr/share/pixmaps/
cp -a ../../../../../data/images/krust.png %{buildroot}/usr/share/pixmaps/
cp -a ../../../../../data/images/krust.svg %{buildroot}/usr/share/pixmaps/
cp -a ../../../../../*.desktop %{buildroot}/usr/share/applications/

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.svg
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/pixmaps/io.miguelbaldi.KRust.png
%{_datadir}/pixmaps/io.miguelbaldi.KRust.svg
%{_datadir}/pixmaps/io.miguelbaldi.KRust-symbolic.svg
%{_datadir}/pixmaps/io.miguelbaldi.KRust-symbolic.png
Loading

0 comments on commit 47128ab

Please sign in to comment.