diff --git a/.github/workflows/omnipackage.yml b/.github/workflows/omnipackage.yml new file mode 100644 index 0000000..a1b1b64 --- /dev/null +++ b/.github/workflows/omnipackage.yml @@ -0,0 +1,52 @@ +name: Build Linux packages (omnipackage) + +on: + workflow_dispatch: + push: + branches: [main] + +jobs: + list-distros: + runs-on: ubuntu-24.04 + outputs: + distros: ${{ steps.get-distros.outputs.distros }} + steps: + - name: Install omnipackage + run: | + echo 'deb https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04 stable/' | sudo tee /etc/apt/sources.list.d/omnipackage_omnipackage.list + curl -fsSL https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04/stable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/omnipackage_omnipackage.gpg > /dev/null + sudo apt-get update + sudo apt-get install -y omnipackage + + - uses: actions/checkout@v6 + + - name: Get distro list + id: get-distros + run: echo "distros=$(omnipackage info --list-distros . --format json)" >> "$GITHUB_OUTPUT" + + release: + needs: [list-distros] + runs-on: ubuntu-24.04 + concurrency: + group: omnipackage-${{ matrix.distro }} + cancel-in-progress: false + strategy: + fail-fast: false + matrix: + distro: ${{ fromJson(needs.list-distros.outputs.distros) }} + steps: + - name: Install omnipackage + run: | + echo 'deb https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04 stable/' | sudo tee /etc/apt/sources.list.d/omnipackage_omnipackage.list + curl -fsSL https://repositories.omnipackage.org/omnipackage-rs/stable/ubuntu_24.04/stable/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/omnipackage_omnipackage.gpg > /dev/null + sudo apt-get update + sudo apt-get install -y omnipackage + + - uses: actions/checkout@v6 + with: + submodules: recursive + + - run: echo "${{ secrets.OMNIPACKAGE_DOTENV }}" > .env + + - name: Release packages for ${{ matrix.distro }} + run: omnipackage release . --distros "${{ matrix.distro }}" --repository "R2 test repo" diff --git a/.omnipackage/PKGBUILD.liquid b/.omnipackage/PKGBUILD.liquid new file mode 100644 index 0000000..1033eaf --- /dev/null +++ b/.omnipackage/PKGBUILD.liquid @@ -0,0 +1,25 @@ +# PKGBUILD template rendered at build time. {{ vars }} come from config.yml. +# Cargo binary is `procman` (Cargo.toml [[bin]]), package name is also procman. +# Maintainer: {{ maintainer }} +pkgname={{ package_name }} +pkgver={{ version }} +pkgrel=1 +pkgdesc="{{ description }}" +arch=("$(uname -m)") +url="{{ homepage }}" +license=('GPL-3.0-or-later') +{% if runtime_dependencies.size > 0 %}depends=({{ runtime_dependencies | join: ' ' }}){% endif %} +# makepkg defaults LTO on; disable it — breaks linking prebuilt C/asm (e.g. aws-lc-rs/ring). +options=('!lto') +source=("{{ source_folder_name }}.tar.gz") +sha256sums=('SKIP') + +build() { + cd "$srcdir/{{ source_folder_name }}" + cargo build --release +} + +package() { + cd "$srcdir/{{ source_folder_name }}" + install -Dm755 target/release/procman "$pkgdir/usr/bin/procman" +} diff --git a/.omnipackage/config.yml b/.omnipackage/config.yml new file mode 100644 index 0000000..84984df --- /dev/null +++ b/.omnipackage/config.yml @@ -0,0 +1,107 @@ +# omnipackage configuration. Docs: https://docs.omnipackage.org +# +# Before publishing (not needed for local builds): +# 1. Generate a GPG key: omnipackage gpg generate -n "Oleg Antonyan" -e oleg.b.antonyan@gmail.com --format base64 +# Put the printed value into GPG_KEY (e.g. in .env). +# 2. Configure a real repository below. + +# Reads the version from Cargo.toml [package]. Anchored to line start so it +# ignores the indented `version = ` lines inside dependency tables. +version_extractors: + - name: default + provider: "file" + file: + file: "Cargo.toml" + regex: '(?m)^version = "([^"]+)"' + +common: &common + package_name: "procman" + maintainer: "Oleg Antonyan " + homepage: "https://github.com/a-chacon/procman" + description: "Terminal UI for managing Procfile-based applications" + +ignore_source_files: + - .git + - .env + - .DS_Store + - "*.log" + - /target + +repositories: + - name: R2 test repo + provider: s3 + gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}" + <<: *common + s3: + bucket: repositories-test + path_in_bucket: "procman" + bucket_public_url: "https://repositories-test.omnipackage.org" + endpoint: "${CLOUDFLARE_R2_ENDPOINT}" + access_key_id: "${CLOUDFLARE_R2_ACCESS_KEY_ID}" + secret_access_key: "${CLOUDFLARE_R2_SECRET_ACCESS_KEY}" + region: auto + force_path_style: true + cloudflare_zone_id: "${CLOUDFLARE_ZONE_ID}" + cloudflare_api_token: "${CLOUDFLARE_API_TOKEN}" + + - name: Local test + gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}" + provider: localfs + <<: *common + localfs: + path: "/run/media/oleg/c3996ce0-a379-4403-9d64-7d4c0536463f/dev/omnipackage-repos/procman" + + +# Edition 2024 needs rustc >= 1.85, newer than several distros ship. install_rust.sh +# keeps the distro toolchain when it's new enough, else downloads a current one. + +# Fedora / openSUSE: ship rust; install_rust.sh upgrades it only if too old. +rpm: &rpm + <<: *common + build_dependencies: ["rust", "cargo", "gcc"] + before_build_script: ".omnipackage/install_rust.sh" + rpm: + spec_template: ".omnipackage/specfile.spec.liquid" + +# RHEL clones / Mageia: rust is absent or too old; install_rust.sh downloads it. +el: &el + <<: *common + build_dependencies: ["curl", "gcc", "make"] + before_build_script: ".omnipackage/install_rust.sh" + rpm: + spec_template: ".omnipackage/specfile.spec.liquid" + +# Debian/Ubuntu: apt cargo is too old; install_rust.sh downloads a current one. +deb: &deb + <<: *common + build_dependencies: ["curl", "build-essential"] + before_build_script: ".omnipackage/install_rust.sh" + deb: + debian_templates: ".omnipackage/deb" + +# Arch / Manjaro: distro rust is always current; build straight from PKGBUILD. +pacman: &pacman + <<: *common + build_dependencies: ["rust"] + pacman: + pkgbuild_template: ".omnipackage/PKGBUILD.liquid" + +builds: + - { distro: "fedora_42", <<: *rpm } + - { distro: "fedora_43", <<: *rpm } + - { distro: "fedora_44", <<: *rpm } + - { distro: "opensuse_tumbleweed", <<: *rpm } + - { distro: "opensuse_15.6", <<: *rpm } + - { distro: "opensuse_16.0", <<: *rpm } + - { distro: "debian_12", <<: *deb } + - { distro: "debian_13", <<: *deb } + - { distro: "ubuntu_22.04", <<: *deb } + - { distro: "ubuntu_24.04", <<: *deb } + - { distro: "ubuntu_26.04", <<: *deb } + - { distro: "arch", <<: *pacman } + - { distro: "manjaro", <<: *pacman } + - { distro: "almalinux_9", <<: *el } + - { distro: "almalinux_10", <<: *el } + - { distro: "rockylinux_9", <<: *el } + - { distro: "rockylinux_10", <<: *el } + - { distro: "mageia_9", <<: *el } diff --git a/.omnipackage/deb/changelog.liquid b/.omnipackage/deb/changelog.liquid new file mode 100644 index 0000000..08c2891 --- /dev/null +++ b/.omnipackage/deb/changelog.liquid @@ -0,0 +1,5 @@ +{{ package_name }} ({{ version }}-0) stable; urgency=low + + * Release {{ version }} + + -- {{ maintainer }} {{ current_time_rfc2822 }} diff --git a/.omnipackage/deb/compat.liquid b/.omnipackage/deb/compat.liquid new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/.omnipackage/deb/compat.liquid @@ -0,0 +1 @@ +10 diff --git a/.omnipackage/deb/control.liquid b/.omnipackage/deb/control.liquid new file mode 100644 index 0000000..f399a9d --- /dev/null +++ b/.omnipackage/deb/control.liquid @@ -0,0 +1,15 @@ +Source: {{ package_name }} +Section: utils +Priority: optional +Maintainer: {{ maintainer }} +Build-Depends: debhelper (>= 8.0.0), {{ build_dependencies | join: ', ' }} +Standards-Version: 4.6.2 +Homepage: {{ homepage }} + +Package: {{ package_name }} +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, {{ runtime_dependencies | join: ', ' }} +Description: {{ description }} + procman monitors, searches, and controls multiple Procfile-defined + processes in a single terminal dashboard, with live log streaming, + VT100 interactive mode, and per-process start/stop/restart. diff --git a/.omnipackage/deb/rules.liquid b/.omnipackage/deb/rules.liquid new file mode 100644 index 0000000..bddf0dc --- /dev/null +++ b/.omnipackage/deb/rules.liquid @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +# debian.rules — Debian build rules. Indents are TABS, not spaces. +# -*- makefile -*- + +export DESTROOT=$(CURDIR)/debian/{{ package_name }} +# export DH_VERBOSE=1 + +%: + dh $@ --parallel + +override_dh_auto_build: + cargo build --release + +override_dh_auto_clean: + cargo clean + dh_auto_clean + +override_dh_auto_install: + install -d -m755 $(DESTROOT)/usr/bin/ + install -m755 target/release/{{ package_name }} $(DESTROOT)/usr/bin/{{ package_name }} diff --git a/.omnipackage/install_rust.sh b/.omnipackage/install_rust.sh new file mode 100755 index 0000000..57ce861 --- /dev/null +++ b/.omnipackage/install_rust.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Ensures a Rust toolchain new enough for edition 2024 (rustc >= 1.85). +# Keeps the distro toolchain when it qualifies, else downloads a current one. +# Runs inside the build container; safe to re-run. + +set -xEeuo pipefail + +MIN_MINOR=85 +RUST_VERSION=1.95.0 + +if command -v cargo >/dev/null 2>&1; then + ver=$(cargo --version | awk '{print $2}') # e.g. 1.86.0 + major=${ver%%.*} + minor=${ver#*.}; minor=${minor%%.*} + if [ "${major:-0}" -gt 1 ] || { [ "${major:-0}" -eq 1 ] && [ "${minor:-0}" -ge "$MIN_MINOR" ]; }; then + echo "Using system cargo $ver" + exit 0 + fi + echo "System cargo $ver is too old for edition 2024; downloading $RUST_VERSION" +fi + +ARCH=$(uname -m) +curl -O https://static.rust-lang.org/dist/rust-${RUST_VERSION}-${ARCH}-unknown-linux-gnu.tar.gz +tar -xzf rust-*.tar.gz +cd rust-*/ +./install.sh --prefix=/usr +cd .. +rm -rf rust-* diff --git a/.omnipackage/specfile.spec.liquid b/.omnipackage/specfile.spec.liquid new file mode 100644 index 0000000..9330d05 --- /dev/null +++ b/.omnipackage/specfile.spec.liquid @@ -0,0 +1,43 @@ +# RPM spec template rendered at build time. +# Cargo binary is `procman` (Cargo.toml [[bin]]), package name is also procman. +Name: {{ package_name }} +Version: {{ version }} +Release: 1%{?dist} +Summary: {{ description }} +License: GPL-3.0-or-later +URL: {{ homepage }} +Source0: {{ source_folder_name }}.tar.gz +Vendor: OmniPackage + +BuildRequires: {{ build_dependencies | join: ' ' }} +{% if runtime_dependencies.size > 0 %} +Requires: {{ runtime_dependencies | join: ', ' }} +{% endif %} + +%define debug_package %{nil} +%define _build_id_links none + +%description +{{ description }} + + +%prep +%setup -q + + +%build +cargo build --release + + +%install +install -d -m755 %{buildroot}/usr/bin/ +install -m755 target/release/procman %{buildroot}/usr/bin/procman + + +%files +%attr(755, root, root) /usr/bin/procman + + +%changelog +* Wed Jun 24 2026 {{ maintainer }} +- Initial package release