From e22e1210b117c95f3aa7f877b3217c623f7bcfa9 Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Sun, 18 Jan 2026 16:35:31 +0100 Subject: Simplify CI command --- .build.yml | 45 ++++++++++++++++++++++++++++++++++++++++++++ .builds/x86_64_arch.yml | 50 ------------------------------------------------- Makefile | 15 +++++++++++++-- 3 files changed, 58 insertions(+), 52 deletions(-) create mode 100644 .build.yml delete mode 100644 .builds/x86_64_arch.yml diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..37d77a6 --- /dev/null +++ b/.build.yml @@ -0,0 +1,45 @@ +image: archlinux +packages: + - make + - minisign + - rsync + - coreutils + - clang + - lld + - rustup + - curl + - tar + - gzip + - gettext + - python-poetry + - flatpak + - flatpak-builder + - gtk4 + - libadwaita + - gtksourceview5 + - fakeroot + - podman +sources: + - git@git.sr.ht:~rbdr/map-linux + - https://github.com/flatpak/flatpak-builder-tools +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 + - 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: | + cd map-linux + make -e target=x86_64-unknown-linux-gnu -e flatpak_cargo_generator=/home/build/flatpak-builder-tools/cargo ci diff --git a/.builds/x86_64_arch.yml b/.builds/x86_64_arch.yml deleted file mode 100644 index 3b90e37..0000000 --- a/.builds/x86_64_arch.yml +++ /dev/null @@ -1,50 +0,0 @@ -image: archlinux -packages: - - make - - minisign - - rsync - - coreutils - - clang - - lld - - rustup - - curl - - tar - - gzip - - gettext - - python-poetry - - flatpak - - flatpak-builder - - gtk4 - - libadwaita - - gtksourceview5 - - fakeroot - - podman -sources: - - git@git.sr.ht:~rbdr/map-linux - - https://github.com/flatpak/flatpak-builder-tools -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 - - 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: | - cd map-linux - if [ "$GIT_REF" = "refs/heads/main" ]; then - make -e target=x86_64-unknown-linux-gnu -e channel=unstable -e flatpak_cargo_generator=/home/build/flatpak-builder-tools/cargo release - elif echo "$GIT_REF" | grep -q "refs/tags/"; then - channel=$(echo "$GIT_REF" | sed 's|refs/tags/||') - make -e target=x86_64-unknown-linux-gnu -e channel=$channel -e flatpak_cargo_generator=/home/build/flatpak-builder-tools/cargo release - fi diff --git a/Makefile b/Makefile index b842136..e7e7bd4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -profile := release +profile := dev target = $(shell rustc -vV | grep host | awk '{print $$2}') channel := unstable @@ -249,7 +249,8 @@ distribute: distribute-tar distribute-flatpak distribute-appimage distribute-pac # Release ###################################################################### -release: lint build-containers package distribute +release: + $(MAKE) profile=release build-containers package distribute # Installation ################################################################# @@ -277,6 +278,16 @@ uninstall: rm -f $(prefix)/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \ done +ci: lint +# Installation ################################################################# +ifeq ($(GIT_REF),refs/heads/main) + $(MAKE) -e channel=unstable release +else ifneq (,$(findstring refs/tags/,$(GIT_REF))) + $(MAKE) -e channel=$(subst refs/tags/,,$(GIT_REF)) release +else + @echo "Not in CI environment." +endif + .PHONY: default build test coverage format lint \ find_translatable_files extract_strings compile_translations \ update_flatpak_dependencies \ -- cgit