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
52 changes: 52 additions & 0 deletions .github/workflows/omnipackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Linux packages (omnipackage)

on:
workflow_dispatch:
push:
branches: [master]

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 }}"
264 changes: 264 additions & 0 deletions .omnipackage/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
version_extractors:
- name: package_json
provider: "file"
file:
file: "package.json"
regex: '"version": "(.+)-dev"'

common: &common
package_name: "pulsar-dev"
maintainer: "Chuck Norris <chuck@norr.is>"
homepage: https://pulsar-edit.dev/
description: A community-led, hyper-hackable text editor

repositories:
- name: R2 test repo
provider: s3
gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}"
<<: *common
s3:
bucket: repositories-test
path_in_bucket: "pulsar-dev"
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
<<: *common
gpg_private_key_base64: "${GPG_PRIVATE_KEY_BASE64}"
provider: localfs
localfs:
path: /run/media/oleg/c3996ce0-a379-4403-9d64-7d4c0536463f/dev/omnipackage-repos/pulsar-dev

rpm: &rpm
<<: *common
before_build_script: ".omnipackage/prepare.sh"
rpm:
spec_template: ".omnipackage/specfile.spec.liquid"

deb: &deb
<<: *common
before_build_script: ".omnipackage/prepare.sh"
deb:
debian_templates: ".omnipackage/deb"

# Shared libs are picked up automatically by rpmbuild's dependency generator
# (and by dpkg-shlibdeps for debs). Only list things ELF scanning can't infer:
# commands invoked at runtime and services we depend on via pkexec/etc.
opensuse: &opensuse
build_dependencies:
[
"libsecret-devel",
"libX11-devel",
"libxkbfile-devel",
"gcc",
"gcc-c++",
"make",
"python313-distutils-extra",
"wget",
"git",
"wayland-devel",
"libxkbcommon-devel",
"libgnome-keyring-devel",
"pkg-config",
]
runtime_dependencies:
[
"git",
"xdg-utils",
"polkit",
]
<<: *rpm

# Fedora differs from openSUSE on package names: pkgconf-pkg-config provides
# pkg-config, and libgnome-keyring-devel was retired (libsecret is enough).
fedora: &fedora
build_dependencies:
[
"libsecret-devel",
"libX11-devel",
"libxkbfile-devel",
"gcc",
"gcc-c++",
"make",
"python3",
"python3-setuptools",
"wget",
"git",
"wayland-devel",
"libxkbcommon-devel",
"pkgconf-pkg-config",
]
runtime_dependencies:
[
"git",
"xdg-utils",
"polkit",
]
<<: *rpm

debian: &debian
build_dependencies:
[
"build-essential",
"git",
"wget",
"curl",
"ca-certificates",
"pkg-config",
"python3",
"python3-setuptools",
"libsecret-1-dev",
"libx11-dev",
"libxkbfile-dev",
"libwayland-dev",
"libxkbcommon-dev",
]
runtime_dependencies:
[
"git",
"xdg-utils",
"policykit-1",
"libglib2.0-bin | kde-cli-tools | kde-runtime",
]
<<: *deb

# RHEL clones (AlmaLinux/RockyLinux). EL9 defaults python3 to 3.9 (works for
# node-gyp out of the box); EL10 ships 3.12 (the python3-setuptools dep gives
# us the vendored distutils shim prepare.sh's symlink picks up).
# libxkbfile-devel is intentionally omitted from build_dependencies because
# it lives in CRB (disabled by default on AlmaLinux/Rocky). prepare.sh
# capability-detects the CRB repo file and enables it inline (no-op on
# Fedora / non-dnf distros).
redhat: &redhat
build_dependencies:
[
"libsecret-devel",
"libX11-devel",
"gcc",
"gcc-c++",
"make",
"python3",
"python3-setuptools",
"wget",
"git",
"wayland-devel",
"libxkbcommon-devel",
"pkgconf-pkg-config",
]
runtime_dependencies:
[
"git",
"xdg-utils",
"polkit",
]
<<: *rpm

# Mageia ships -devel headers under the lib64*-devel namespace on x86_64,
# and uses bare `pkgconf` rather than pkgconf-pkg-config.
mageia: &mageia
build_dependencies:
[
"lib64secret-devel",
"lib64x11-devel",
"lib64xkbfile-devel",
"gcc",
"gcc-c++",
"make",
"python3",
"python3-setuptools",
"wget",
"git",
"lib64wayland-devel",
"lib64xkbcommon-devel",
"pkgconf",
]
runtime_dependencies:
[
"git",
"xdg-utils",
"polkit",
]
<<: *rpm

builds:
- distro: "opensuse_tumbleweed"
<<: *opensuse

- distro: "opensuse_16.0"
<<: *opensuse

- distro: "opensuse_15.6"
# Leap 15.6's default python3 is 3.6 (too old for node-gyp); install
# python311 explicitly. stdlib distutils is still present in 3.11, so no
# setuptools shim or python*-distutils-extra is needed.
<<: *opensuse
build_dependencies:
[
"libsecret-devel",
"libX11-devel",
"libxkbfile-devel",
"gcc",
"gcc-c++",
"make",
"python311",
"wget",
"git",
"wayland-devel",
"libxkbcommon-devel",
"libgnome-keyring-devel",
"pkg-config",
]

- distro: "fedora_42"
<<: *fedora

- distro: "fedora_43"
<<: *fedora

- distro: "fedora_44"
<<: *fedora

- distro: "fedora_rawhide"
<<: *fedora

- distro: "debian_12"
<<: *debian

- distro: "debian_13"
<<: *debian

- distro: "ubuntu_22.04"
<<: *debian

- distro: "ubuntu_24.04"
<<: *debian

- distro: "ubuntu_26.04"
<<: *debian

- distro: "almalinux_9"
<<: *redhat

- distro: "almalinux_10"
<<: *redhat

- distro: "rockylinux_9"
<<: *redhat

- distro: "rockylinux_10"
<<: *redhat

- distro: "mageia_9"
<<: *mageia

ignore_source_files:
- .git
- .env
- "*.log"
- node_modules
5 changes: 5 additions & 0 deletions .omnipackage/deb/changelog.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ package_name }} ({{ version }}-0) stable; urgency=low

* Release {{ version }}

-- {{ maintainer }} {{ current_time_rfc2822 }}
1 change: 1 addition & 0 deletions .omnipackage/deb/compat.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
12 changes: 12 additions & 0 deletions .omnipackage/deb/control.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Source: {{ package_name }}
Section: devel
Priority: optional
Maintainer: {{ maintainer }}
Build-Depends: debhelper (>= 8.0.0), {{ build_dependencies | join: ', ' }}
Standards-Version: 3.9.4
Homepage: {{ homepage }}

Package: {{ package_name }}
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}{% if runtime_dependencies.size > 0 %}, {{ runtime_dependencies | join: ', ' }}{% endif %}
Description: {{ description }}
8 changes: 8 additions & 0 deletions .omnipackage/deb/postinst.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
# Chromium's setuid sandbox helper must be 4755 root:root or the renderer
# refuses to start. dh_fixperms strips the bit during build, so set it here.
set -e

chmod 4755 /usr/lib/{{ package_name }}/chrome-sandbox

exit 0
31 changes: 31 additions & 0 deletions .omnipackage/deb/rules.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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

# install.sh is shared with the rpm spec; second arg is the package name so
# /usr/lib/<pkg>/ and the launcher symlinks line up.
override_dh_auto_install:
$(CURDIR)/.omnipackage/install.sh $(DESTROOT) {{ package_name }}

# Pulsar bundles its own dependencies under /usr/lib/<pkg>/. Skipping the
# default strip pass keeps electron's native helper binaries usable; without
# this dh_strip mangles libffmpeg/libvk_swiftshader and the editor segfaults
# on launch.
override_dh_strip:

# Don't try to mess with the bundled .so/.node files — they're shipped as-is
# by electron-builder and the binary patcher would otherwise rewrite RPATHs we
# rely on.
override_dh_shlibdeps:

# chrome-sandbox needs setuid root at runtime (see postinst). Skip the
# default fixperms so the bit survives if anything ever sets it pre-package;
# postinst restores it on install regardless.
override_dh_fixperms:
dh_fixperms -X chrome-sandbox
Loading