aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Beltrán del Río <jj@r.bdr.sh>2026-01-18 12:25:28 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-01-18 12:25:35 +0100
commit87f291bd746a910655535204c9c9123e64a36fee (patch)
tree6f5f1927ff4250561829397c2bf81fe1fcc57e7f
parentca780c35c2f6bb23788eefd53b7a7625d15d80d8 (diff)
Attempt to run individual builds per distribution
-rw-r--r--.builds/x86_64_arch.yml (renamed from .build.yml)10
-rw-r--r--.builds/x86_64_debian_oldstable.yml43
-rw-r--r--.builds/x86_64_debian_stable.yml41
-rw-r--r--.builds/x86_64_debian_testing.yml41
-rw-r--r--.builds/x86_64_fedora42.yml36
-rw-r--r--.builds/x86_64_fedora43.yml36
-rw-r--r--.builds/x86_64_fedora_rawhide.yml36
-rw-r--r--Makefile138
8 files changed, 348 insertions, 33 deletions
diff --git a/.build.yml b/.builds/x86_64_arch.yml
index 16a5238..3dad0f4 100644
--- a/.build.yml
+++ b/.builds/x86_64_arch.yml
@@ -34,14 +34,14 @@ tasks:
make set_rust
- install_binstall: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- - install_builders: |
- cargo binstall cargo-generate-rpm --no-confirm
- cargo binstall cargo-deb --no-confirm
- setup_flatpak_tools: |
cd flatpak-builder-tools/cargo
poetry install
- setup_flathub: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- - release: |
+ - release_arch: |
cd map-linux
- make -e architectures=x86_64-unknown-linux-gnu -e flatpak_cargo_generator=/home/build/flatpak-builder-tools/cargo ci
+ make -e target=x86_64-unknown-linux-gnu -e flatpak_cargo_generator=/home/build/flatpak-builder-tools/cargo ci-arch
+ - release_generic: |
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e flatpak_cargo_generator=/home/build/flatpak-builder-tools/cargo ci-generic
diff --git a/.builds/x86_64_debian_oldstable.yml b/.builds/x86_64_debian_oldstable.yml
new file mode 100644
index 0000000..b0c0829
--- /dev/null
+++ b/.builds/x86_64_debian_oldstable.yml
@@ -0,0 +1,43 @@
+# NOTE: Debian oldstable (bullseye) may not have libadwaita available.
+# This build might fail. Consider removing if bullseye support isn't needed.
+image: debian/oldstable
+packages:
+ - make
+ - minisign
+ - rsync
+ - coreutils
+ - clang
+ - lld
+ - curl
+ - tar
+ - gzip
+ - gettext
+ - libgtk-4-dev
+ - libadwaita-1-dev
+ - libgtksourceview-5-dev
+ - pkg-config
+sources:
+ - git@git.sr.ht:~rbdr/map-linux
+environment:
+ GPG_TTY: /dev/pts/0
+ CARGO_HOME: /home/build/.cargo
+ PATH: /home/build/.cargo/bin:/usr/local/bin:/usr/bin:/bin
+secrets:
+ - a1e0e3da-c1ad-473a-ad69-8878f267a628
+ - eaecf3b4-a508-4fa6-a36e-6b9ed4468eae
+ - f80356df-eb81-487f-8739-fbf08bf204dc
+ - 05763ec6-2f17-46b5-90f6-963482975b8b
+tasks:
+ - install_rust: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ source ~/.cargo/env
+ - install_binstall: |
+ source ~/.cargo/env
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_builders: |
+ source ~/.cargo/env
+ cargo binstall cargo-deb --no-confirm
+ - release: |
+ source ~/.cargo/env
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e distro=bullseye ci-deb
diff --git a/.builds/x86_64_debian_stable.yml b/.builds/x86_64_debian_stable.yml
new file mode 100644
index 0000000..32900e5
--- /dev/null
+++ b/.builds/x86_64_debian_stable.yml
@@ -0,0 +1,41 @@
+image: debian/stable
+packages:
+ - make
+ - minisign
+ - rsync
+ - coreutils
+ - clang
+ - lld
+ - curl
+ - tar
+ - gzip
+ - gettext
+ - libgtk-4-dev
+ - libadwaita-1-dev
+ - libgtksourceview-5-dev
+ - pkg-config
+sources:
+ - git@git.sr.ht:~rbdr/map-linux
+environment:
+ GPG_TTY: /dev/pts/0
+ CARGO_HOME: /home/build/.cargo
+ PATH: /home/build/.cargo/bin:/usr/local/bin:/usr/bin:/bin
+secrets:
+ - a1e0e3da-c1ad-473a-ad69-8878f267a628
+ - eaecf3b4-a508-4fa6-a36e-6b9ed4468eae
+ - f80356df-eb81-487f-8739-fbf08bf204dc
+ - 05763ec6-2f17-46b5-90f6-963482975b8b
+tasks:
+ - install_rust: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ source ~/.cargo/env
+ - install_binstall: |
+ source ~/.cargo/env
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_builders: |
+ source ~/.cargo/env
+ cargo binstall cargo-deb --no-confirm
+ - release: |
+ source ~/.cargo/env
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e distro=bookworm ci-deb
diff --git a/.builds/x86_64_debian_testing.yml b/.builds/x86_64_debian_testing.yml
new file mode 100644
index 0000000..d01fa9e
--- /dev/null
+++ b/.builds/x86_64_debian_testing.yml
@@ -0,0 +1,41 @@
+image: debian/testing
+packages:
+ - make
+ - minisign
+ - rsync
+ - coreutils
+ - clang
+ - lld
+ - curl
+ - tar
+ - gzip
+ - gettext
+ - libgtk-4-dev
+ - libadwaita-1-dev
+ - libgtksourceview-5-dev
+ - pkg-config
+sources:
+ - git@git.sr.ht:~rbdr/map-linux
+environment:
+ GPG_TTY: /dev/pts/0
+ CARGO_HOME: /home/build/.cargo
+ PATH: /home/build/.cargo/bin:/usr/local/bin:/usr/bin:/bin
+secrets:
+ - a1e0e3da-c1ad-473a-ad69-8878f267a628
+ - eaecf3b4-a508-4fa6-a36e-6b9ed4468eae
+ - f80356df-eb81-487f-8739-fbf08bf204dc
+ - 05763ec6-2f17-46b5-90f6-963482975b8b
+tasks:
+ - install_rust: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ source ~/.cargo/env
+ - install_binstall: |
+ source ~/.cargo/env
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_builders: |
+ source ~/.cargo/env
+ cargo binstall cargo-deb --no-confirm
+ - release: |
+ source ~/.cargo/env
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e distro=trixie ci-deb
diff --git a/.builds/x86_64_fedora42.yml b/.builds/x86_64_fedora42.yml
new file mode 100644
index 0000000..0f9aac9
--- /dev/null
+++ b/.builds/x86_64_fedora42.yml
@@ -0,0 +1,36 @@
+image: fedora/42
+packages:
+ - make
+ - minisign
+ - rsync
+ - coreutils
+ - clang
+ - lld
+ - rustup
+ - curl
+ - tar
+ - gzip
+ - gettext
+ - gtk4-devel
+ - libadwaita-devel
+ - gtksourceview5-devel
+sources:
+ - git@git.sr.ht:~rbdr/map-linux
+environment:
+ GPG_TTY: /dev/pts/0
+secrets:
+ - a1e0e3da-c1ad-473a-ad69-8878f267a628
+ - eaecf3b4-a508-4fa6-a36e-6b9ed4468eae
+ - f80356df-eb81-487f-8739-fbf08bf204dc
+ - 05763ec6-2f17-46b5-90f6-963482975b8b
+tasks:
+ - set_rust: |
+ cd map-linux
+ make set_rust
+ - install_binstall: |
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_builders: |
+ cargo binstall cargo-generate-rpm --no-confirm
+ - release: |
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e distro=fedora42 ci-rpm
diff --git a/.builds/x86_64_fedora43.yml b/.builds/x86_64_fedora43.yml
new file mode 100644
index 0000000..77e9c95
--- /dev/null
+++ b/.builds/x86_64_fedora43.yml
@@ -0,0 +1,36 @@
+image: fedora/43
+packages:
+ - make
+ - minisign
+ - rsync
+ - coreutils
+ - clang
+ - lld
+ - rustup
+ - curl
+ - tar
+ - gzip
+ - gettext
+ - gtk4-devel
+ - libadwaita-devel
+ - gtksourceview5-devel
+sources:
+ - git@git.sr.ht:~rbdr/map-linux
+environment:
+ GPG_TTY: /dev/pts/0
+secrets:
+ - a1e0e3da-c1ad-473a-ad69-8878f267a628
+ - eaecf3b4-a508-4fa6-a36e-6b9ed4468eae
+ - f80356df-eb81-487f-8739-fbf08bf204dc
+ - 05763ec6-2f17-46b5-90f6-963482975b8b
+tasks:
+ - set_rust: |
+ cd map-linux
+ make set_rust
+ - install_binstall: |
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_builders: |
+ cargo binstall cargo-generate-rpm --no-confirm
+ - release: |
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e distro=fedora43 ci-rpm
diff --git a/.builds/x86_64_fedora_rawhide.yml b/.builds/x86_64_fedora_rawhide.yml
new file mode 100644
index 0000000..14ba738
--- /dev/null
+++ b/.builds/x86_64_fedora_rawhide.yml
@@ -0,0 +1,36 @@
+image: fedora/rawhide
+packages:
+ - make
+ - minisign
+ - rsync
+ - coreutils
+ - clang
+ - lld
+ - rustup
+ - curl
+ - tar
+ - gzip
+ - gettext
+ - gtk4-devel
+ - libadwaita-devel
+ - gtksourceview5-devel
+sources:
+ - git@git.sr.ht:~rbdr/map-linux
+environment:
+ GPG_TTY: /dev/pts/0
+secrets:
+ - a1e0e3da-c1ad-473a-ad69-8878f267a628
+ - eaecf3b4-a508-4fa6-a36e-6b9ed4468eae
+ - f80356df-eb81-487f-8739-fbf08bf204dc
+ - 05763ec6-2f17-46b5-90f6-963482975b8b
+tasks:
+ - set_rust: |
+ cd map-linux
+ make set_rust
+ - install_binstall: |
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_builders: |
+ cargo binstall cargo-generate-rpm --no-confirm
+ - release: |
+ cd map-linux
+ make -e target=x86_64-unknown-linux-gnu -e distro=fedora-rawhide ci-rpm
diff --git a/Makefile b/Makefile
index 9f103e3..ff49930 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,8 @@ output_dir := debug
else
output_dir := $(profile)
endif
-architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
+# Extract just the architecture (first component of target triple)
+arch = $(firstword $(subst -, ,$(target)))
app_name := map
deploy_host := deploy@build.r.bdr.sh
deploy_path := /srv/http/build.r.bdr.sh/$(app_name)-linux
@@ -17,10 +18,23 @@ linuxdeploy := .cache/linuxdeploy.AppImage
pkgver := $(shell grep '^pkgver=' build-aux/PKGBUILD | cut -d= -f2)
pkgrel := $(shell grep '^pkgrel=' build-aux/PKGBUILD | cut -d= -f2)
+# Distro-specific builds (set via: make -e distro=fedora43)
+distro :=
+
+# Podman images for arm builds
+fedora_versions := fedora42 fedora43 fedora-rawhide
+debian_versions := bookworm trixie bullseye
+fedora_image_fedora42 := fedora:42
+fedora_image_fedora43 := fedora:43
+fedora_image_fedora-rawhide := fedora:rawhide
+debian_image_bookworm := debian:bookworm
+debian_image_trixie := debian:trixie
+debian_image_bullseye := debian:bullseye
+
define sign_and_deploy
- @./scripts/sign.sh "$(1)" "$(channel)" "$(architecture)"
- rsync -avz $(1) $(deploy_host):$(deploy_path)
- rsync -avz $(1).minisig $(deploy_host):$(deploy_path)
+ @./scripts/sign.sh "$(1)" "$(channel)" "$(arch)"
+ rsync -avz $(1) $(deploy_host):$(deploy_path)
+ rsync -avz $(1).minisig $(deploy_host):$(deploy_path)
endef
default: build
@@ -72,7 +86,8 @@ po/%/LC_MESSAGES/systems.tranquil.Map.mo: po/%.po
# Packaging ####################################################################
-filename = $(app_name)-$(target)-$(channel)
+# Filename format: map-aarch64-unstable.flatpak or map-aarch64-unstable-fedora43.rpm
+filename = $(app_name)-$(arch)-$(channel)$(if $(distro),-$(distro),)
update_flatpak_dependencies:
cd $(flatpak_cargo_generator) && `poetry env activate` && python3 flatpak-cargo-generator.py $(CURDIR)/Cargo.lock -o $(CURDIR)/build-aux/cargo-sources.json && deactivate
@@ -112,8 +127,8 @@ package-pacman:
@$(eval staging := $(shell mktemp -d))
rsync -a --filter=':- .gitignore' --exclude='.git' . $(staging)/src
cp build-aux/PKGBUILD $(staging)/
- cd $(staging) && PKGEXT='.pkg.tar.gz' makepkg -fd
- mv $(staging)/$(app_name)-$(pkgver)-$(pkgrel)-$(firstword $(subst -, ,$(target))).pkg.tar.gz $(filename).pkg.tar.gz
+ cd $(staging) && PKGEXT='.pkg.tar.gz' makepkg -f
+ mv $(staging)/$(app_name)-$(pkgver)-$(pkgrel)-$(arch).pkg.tar.gz $(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz
@rm -rf $(staging)
$(linuxdeploy):
@@ -157,7 +172,7 @@ distribute-flatpak:
@$(call sign_and_deploy,$(filename).flatpak)
distribute-pacman:
- @$(call sign_and_deploy,$(filename).pkg.tar.gz)
+ @$(call sign_and_deploy,$(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz)
distribute-appimage:
@$(call sign_and_deploy,$(filename).AppImage)
@@ -166,14 +181,65 @@ distribute: distribute-rpm distribute-deb distribute-tar distribute-pacman distr
release: package distribute
-# We can't do cross compile, so for now let's just make it easy to release
-# on arm here
+# ARM builds - run locally for universal formats, podman for distro-specific
arm:
-ifneq ($(channel),)
- $(MAKE) -e profile=release -e channel=$(channel) -e target=aarch64-unknown-linux-gnu release
-else
- $(MAKE) -e profile=release -e channel=unstable -e target=aarch64-unknown-linux-gnu release
+ifndef channel
+ $(eval channel := unstable)
+endif
+ @echo "=== Building ARM packages (channel: $(channel)) ==="
+ @# Build universal formats locally
+ $(MAKE) -e profile=release -e channel=$(channel) -e target=aarch64-unknown-linux-gnu package-tar package-flatpak package-appimage package-pacman
+ @# Build distro-specific packages via podman
+ $(MAKE) -e channel=$(channel) arm-rpm-all arm-deb-all
+ @# Sign and distribute everything
+ $(MAKE) -e profile=release -e channel=$(channel) -e target=aarch64-unknown-linux-gnu distribute-tar distribute-flatpak distribute-appimage distribute-pacman
+ @for v in $(fedora_versions); do \
+ $(MAKE) -e channel=$(channel) -e target=aarch64-unknown-linux-gnu -e distro=$$v distribute-rpm; \
+ done
+ @for v in $(debian_versions); do \
+ $(MAKE) -e channel=$(channel) -e target=aarch64-unknown-linux-gnu -e distro=$$v distribute-deb; \
+ done
+
+# Build all ARM RPMs via podman
+arm-rpm-all:
+ @for v in $(fedora_versions); do \
+ $(MAKE) -e channel=$(channel) -e distro=$$v arm-rpm; \
+ done
+
+# Build single ARM RPM via podman (requires distro= to be set)
+arm-rpm:
+ifndef distro
+ $(error distro is required, e.g., make arm-rpm distro=fedora43)
+endif
+ @echo "=== Building ARM RPM for $(distro) ==="
+ podman run --rm -v $(CURDIR):/src:Z -w /src $(fedora_image_$(distro)) bash -c '\
+ dnf install -y make clang lld curl tar gzip gettext gtk4-devel libadwaita-devel gtksourceview5-devel pkg-config && \
+ curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
+ source $$HOME/.cargo/env && \
+ curl -L --proto "=https" --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && \
+ cargo binstall cargo-generate-rpm --no-confirm && \
+ make -e profile=release -e channel=$(channel) -e target=aarch64-unknown-linux-gnu -e distro=$(distro) package-rpm'
+
+# Build all ARM DEBs via podman
+arm-deb-all:
+ @for v in $(debian_versions); do \
+ $(MAKE) -e channel=$(channel) -e distro=$$v arm-deb; \
+ done
+
+# Build single ARM DEB via podman (requires distro= to be set)
+arm-deb:
+ifndef distro
+ $(error distro is required, e.g., make arm-deb distro=bookworm)
endif
+ @echo "=== Building ARM DEB for $(distro) ==="
+ podman run --rm -v $(CURDIR):/src:Z -w /src $(debian_image_$(distro)) bash -c '\
+ apt-get update && \
+ apt-get install -y make clang lld curl tar gzip gettext libgtk-4-dev libadwaita-1-dev libgtksourceview-5-dev pkg-config && \
+ curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
+ source $$HOME/.cargo/env && \
+ curl -L --proto "=https" --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && \
+ cargo binstall cargo-deb --no-confirm && \
+ make -e profile=release -e channel=$(channel) -e target=aarch64-unknown-linux-gnu -e distro=$(distro) package-deb'
# Installation #################################################################
@@ -203,26 +269,42 @@ uninstall:
done
# CI ###########################################################################
-
-ci: lint
+#
+# CI target for generic builds (flatpak, appimage, tar)
+ci-generic: lint
ifeq ($(GIT_REF),refs/heads/main)
- $(MAKE) -e profile=release -e channel=unstable $(architectures)
+ $(MAKE) -e profile=release -e channel=unstable -e target=$(target) package-tar package-flatpak package-appimage distribute-tar distribute-flatpak distribute-appimage
else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
- $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) $(architectures)
+ $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) -e target=$(target) package-tar package-flatpak package-appimage distribute-tar distribute-flatpak distribute-appimage
endif
-$(architectures):
-ifneq ($(channel),)
- $(MAKE) -e channel=$(channel) -e target=$@ release
-else
- $(MAKE) -e target=$@ build
+# CI target for .pkg.tar.gz builds (arch)
+ci-arch: lint
+ifeq ($(GIT_REF),refs/heads/main)
+ $(MAKE) -e profile=release -e channel=unstable -e target=$(target) package-pacman distribute-pacman
+else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
+ $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) -e target=$(target) package-pacman distribute-pacman
endif
-release_all:
-ifndef channel
- $(error channel is required for release_all)
+# CI target for rpm builds (fedora)
+ci-rpm:
+ifeq ($(GIT_REF),refs/heads/main)
+ $(MAKE) -e profile=release -e channel=unstable -e target=$(target) -e distro=$(distro) package-rpm distribute-rpm
+else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
+ $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) -e target=$(target) -e distro=$(distro) package-rpm distribute-rpm
endif
- $(MAKE) -e profile=release $(architectures)
+# CI target for deb builds (debian)
+ci-deb:
+ifeq ($(GIT_REF),refs/heads/main)
+ $(MAKE) -e profile=release -e channel=unstable -e target=$(target) -e distro=$(distro) package-deb distribute-deb
+else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
+ $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) -e target=$(target) -e distro=$(distro) package-deb distribute-deb
+endif
-.PHONY: default build $(architectures) package package-rpm package-deb package-tar package-flatpak package-pacman package-appimage distribute distribute-rpm distribute-deb distribute-tar distribute-flatpak distribute-pacman distribute-appimage arch prepare set_rust ci release release_all test coverage format update_flatpak_dependencies extract_strings find_translatable_files compile_translations install uninstall
+.PHONY: default build package package-rpm package-deb package-tar package-flatpak package-pacman package-appimage \
+ distribute distribute-rpm distribute-deb distribute-tar distribute-flatpak distribute-pacman distribute-appimage \
+ arm arm-rpm arm-rpm-all arm-deb arm-deb-all \
+ prepare set_rust ci ci-arch ci-rpm ci-deb release test coverage format lint \
+ update_flatpak_dependencies extract_strings find_translatable_files \
+ ci-generic compile_translations install uninstall