Skip to content
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
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get -y install jq devscripts
sudo apt-get -y install jq devscripts rpm

- name: Install Rustup
run: |
Expand All @@ -26,15 +26,23 @@ jobs:
- name: Check Version
run: |
CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 --manifest-path src-tauri/Cargo.toml | jq -r .packages[0].version)
EXPECTED_DEB_VERSION=$(echo $CARGO_VERSION | tr '-' '~')
EXPECTED_ALT_VERSION=$(echo $CARGO_VERSION | tr '-' '~')
if [[ $CARGO_VERSION != ${{ github.event.release.tag_name }} ]]; then
echo "::error file=src-tauri/Cargo.toml::[Version Check] The Cargo manifest version seems out-of-date."
exit 1
fi
if [[ $EXPECTED_DEB_VERSION != $(dpkg-parsechangelog -l packaging/linux/deb/debian/changelog -S Version | cut -d '-' --fields 1) ]]; then
if [[ $EXPECTED_ALT_VERSION != $(dpkg-parsechangelog -l packaging/linux/deb/debian/changelog -S Version | cut -d '-' --fields 1) ]]; then
echo "::error file=packaging/linux/deb/debian/changelog::[Version Check] The Debian changelog seems out-of-date."
exit 1;
fi
if [[ $EXPECTED_ALT_VERSION != $(rpmspec -q --qf "%{VERSION}\n" packaging/linux/rpm/tess-prebuilt.spec) ]]; then
echo "::error file=packaging/linux/deb/debian/changelog::[Version Check] The Fedora prebuilt version seems out-of-date."
exit 1;
fi
if [[ $EXPECTED_ALT_VERSION != $(rpmspec -q --qf "%{VERSION}\n" packaging/linux/rpm/tess.spec) ]]; then
echo "::error file=packaging/linux/deb/debian/changelog::[Version Check] The Fedora version seems out-of-date."
exit 1;
fi

check-linux-build:
name: Check Linux Build
Expand Down Expand Up @@ -143,6 +151,10 @@ jobs:
- i686-unknown-linux-gnu
package:
- deb
- rpm
exclude:
- target: i686-unknown-linux-gnu
package: rpm
include:
- arch: x86_64
target: x86_64-unknown-linux-gnu
Expand All @@ -156,6 +168,8 @@ jobs:
package: deb
- docker: debian:bookworm
package: deb
- docker: fedora:41
package: rpm
runs-on: ubuntu-22.04
container:
image: ${{ matrix.docker }}
Expand Down Expand Up @@ -190,7 +204,7 @@ jobs:
- name: Publish Package
uses: softprops/action-gh-release@v2
with:
files: packaging/out/linux/*.deb
files: packaging/out/linux/*

generate-windows-binaries:
name: Build Windows Binary for Target ${{ matrix.target }}
Expand Down
8 changes: 8 additions & 0 deletions packaging/linux/rpm/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash

# This script is intended to be run on a Fedora system and must be run before
# any attempt at building a package by using ./build.sh. It bootstraps the
# system (ideally a fresh virtual machine or a docker container) by
# installing required dependencies.

dnf install -y mock rpmspec cargo
66 changes: 66 additions & 0 deletions packaging/linux/rpm/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#! /bin/bash

# This script is intended to be run on a Fedora system after a successful
# completion of ./boostrap.sh. The resulting rpm package is moved to
# packaging/out/linux/ (based on the root of the repository).
# If USE_PREBUILT is unset, the script will attempt to build the package from
# source, which may not work at this time. Otherwise, the package will be
# built by using the prebuild binary and the required resources
# (a.k.a. man pages) must be present in packaging/linux/resources/man.
# Env variables:
# * ARCH (required):
# Represent the package architecture and must be any item of this list:
# * x86_64
# * USE_PREBUILT (optional):
# If defined, point to the prebuilt binary going to be packaged, It's the user
# responsibility to ensure that the binary and $ARCH match

set -e

if [[ -z "${ARCH}" ]]; then
echo "error: \$ARCH must be set" >&2 && exit 1
fi


script_dir=$(dirname $(realpath $0))
pkgver=$(rpmspec -q --qf "%{VERSION}\n" "$script_dir/tess.spec")
build_dir="/tmp/build/tess-$pkgver"
sources_dir="/tmp/build/SOURCES"


rm -rf $build_dir
rm -rf $sources_dir
mkdir -p $build_dir
mkdir -p $sources_dir
mkdir -p "$build_dir/resources"

# Finish copying all required file
cp -r "$script_dir/../resources/desktop" "$build_dir/resources/desktop"
cp "$script_dir/../../../LICENSE" "$build_dir"
cp -r "$script_dir/../../../icons" "$build_dir/icons"
cp -r "$script_dir/../../../src" "$build_dir/src"
cp -r "$script_dir/../../../src-tauri" "$build_dir/src-tauri"

if [[ -n "${USE_PREBUILT}" ]]; then
cp "$USE_PREBUILT" "$build_dir/resources/tess"
cp -r "$script_dir/../resources/man" "$build_dir/resources/man"
else
cargo clean --manifest-path "$build_dir/src-tauri/Cargo.toml"
cargo vendor "$build_dir/src-tauri/vendor" --manifest-path "$build_dir/src-tauri/Cargo.toml"
fi

cd $(dirname $build_dir)
tar czf "tess-$pkgver.tar.gz" "tess-$pkgver"
cp "tess-$pkgver.tar.gz" "$sources_dir/"

rm -rf $build_dir
if [[ -n "${USE_PREBUILT}" ]]; then
mock -r "fedora-41-$ARCH" --buildsrpm --spec "$script_dir/tess-prebuilt.spec" --sources "$sources_dir" --resultdir "$build_dir"
mock -r "fedora-41-$ARCH" --rebuild $build_dir/tess-*.src.rpm --define "prebuilt 1"
else
mock -r "fedora-41-$ARCH" --buildsrpm --spec "$script_dir/tess.spec" --sources "$sources_dir" --resultdir "$build_dir"
mock -r "fedora-41-$ARCH" --rebuild $build_dir/tess-*.src.rpm
fi

mkdir -p "$script_dir/../../out/linux/"
cp /var/lib/mock/fedora-41-$ARCH/result/*$ARCH.rpm "$script_dir/../../out/linux/"
87 changes: 87 additions & 0 deletions packaging/linux/rpm/tess-prebuilt.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
%global debug_package %{nil}
%undefine dist


Name: tess
Version: 0.7.0~alpha.15
Release: 1%{?dist}
Summary: Modern and web-based terminal emulator

License: MIT
URL: https://tessapp.dev
Source0: %{name}-%{version}.tar.gz

BuildRequires: cargo-rpm-macros >= 24
BuildRequires: desktop-file-utils


%description
A customizable, simple, and rapid terminal for the new era of technology.
It includes emoji support, tabs, screen splitting, as well as support for themes
and fully customizable settings.


%prep
%setup -q


%check
# No tests defined yet


%build
# Nothing to build


%install
install -Dm755 resources/tess %{buildroot}%{_bindir}/tess
install -Dm644 resources/man/*.1 -t %{buildroot}%{_mandir}/man1/
desktop-file-install --dir=%{buildroot}%{_datadir}/applications resources/desktop/*.desktop
install -Dm644 resources/desktop/servicemenus/*.desktop -t %{buildroot}%{_datadir}/kio/servicemenus/
install -Dm644 icons/16x16/* -t %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/
install -Dm644 icons/24x24/* -t %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/
install -Dm644 icons/32x32/* -t %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
install -Dm644 icons/48x48/* -t %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
install -Dm644 icons/64x64/* -t %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/
install -Dm644 icons/128x128/* -t %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
install -Dm644 icons/256x256/* -t %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
install -Dm644 icons/512x512/* -t %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/


%post
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor;
fi
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || :


%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor;
fi
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || :


%files
%license LICENSE
%{_bindir}/tess
%{_mandir}/man1/*.1*
%{_datadir}/applications/
%{_datadir}/kio/servicemenus/
%{_datadir}/icons/hicolor/16x16/apps/
%{_datadir}/icons/hicolor/24x24/apps/
%{_datadir}/icons/hicolor/32x32/apps/
%{_datadir}/icons/hicolor/48x48/apps/
%{_datadir}/icons/hicolor/64x64/apps/
%{_datadir}/icons/hicolor/128x128/apps/
%{_datadir}/icons/hicolor/256x256/apps/
%{_datadir}/icons/hicolor/512x512/apps/


%changelog
* Mon Jun 23 2025 Clément FOURÉ <[email protected]> - 0.7.0~alpha.15-1
- Initial release
92 changes: 92 additions & 0 deletions packaging/linux/rpm/tess.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Name: tess
Version: 0.7.0~alpha.15
Release: 1%{?dist}
Summary: Modern and web-based terminal emulator

License: MIT
URL: https://tessapp.dev
Source0: %{name}-%{version}.tar.gz

BuildRequires: cargo-rpm-macros >= 24
BuildRequires: desktop-file-utils
BuildRequires: webkit2gtk4.1-devel


%description
A customizable, simple, and rapid terminal for the new era of technology.
It includes emoji support, tabs, screen splitting, as well as support for themes
and fully customizable settings.


%prep
%setup -q
cd src-tauri
%cargo_prep -v vendor


%check
# No tests defined yet


%build
cd src-tauri
export GEN_RESOURCES=1
export SKIP_FRONTEND=1
%cargo_build
%{cargo_license} > THIRD-PARTY-LICENSES


%install
find . -type f -name '*.rs' -exec chmod -x {} +
install -Dm755 src-tauri/target/release/tess %{buildroot}%{_bindir}/tess
install -Dm644 src-tauri/gen/man/*.1 -t %{buildroot}%{_mandir}/man1/
desktop-file-install --dir=%{buildroot}%{_datadir}/applications resources/desktop/*.desktop
install -Dm644 resources/desktop/servicemenus/*.desktop -t %{buildroot}%{_datadir}/kio/servicemenus/
install -Dm644 icons/16x16/* -t %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/
install -Dm644 icons/24x24/* -t %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/
install -Dm644 icons/32x32/* -t %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
install -Dm644 icons/48x48/* -t %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
install -Dm644 icons/64x64/* -t %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/
install -Dm644 icons/128x128/* -t %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
install -Dm644 icons/256x256/* -t %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
install -Dm644 icons/512x512/* -t %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/


%post
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor;
fi
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || :


%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor;
fi
update-mime-database %{_datadir}/mime &> /dev/null || :
update-desktop-database &> /dev/null || :


%files
%license LICENSE
%license src-tauri/THIRD-PARTY-LICENSES
%{_bindir}/tess
%{_mandir}/man1/*.1*
%{_datadir}/applications/
%{_datadir}/kio/servicemenus/
%{_datadir}/icons/hicolor/16x16/apps/
%{_datadir}/icons/hicolor/24x24/apps/
%{_datadir}/icons/hicolor/32x32/apps/
%{_datadir}/icons/hicolor/48x48/apps/
%{_datadir}/icons/hicolor/64x64/apps/
%{_datadir}/icons/hicolor/128x128/apps/
%{_datadir}/icons/hicolor/256x256/apps/
%{_datadir}/icons/hicolor/512x512/apps/


%changelog
* Mon Jun 23 2025 Clément FOURÉ <[email protected]> - 0.7.0~alpha.15-1
- Initial release