diff options
| -rw-r--r-- | .build-aarch64.yml | 37 | ||||
| -rw-r--r-- | .build-x86_64.yml | 37 | ||||
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | Cargo.toml | 4 | ||||
| -rw-r--r-- | Makefile | 24 | ||||
| -rw-r--r-- | resources/systems.tranquil.Map.desktop | 2 |
6 files changed, 102 insertions, 7 deletions
diff --git a/.build-aarch64.yml b/.build-aarch64.yml new file mode 100644 index 0000000..896e710 --- /dev/null +++ b/.build-aarch64.yml @@ -0,0 +1,37 @@ +image: archlinux +arch: aarch64 +packages: + - make + - minisign + - rsync + - coreutils + - clang + - lld + - rustup + - tar + - gzip + - gtk4 + - libadwaita + - gtksourceview5 + - gettext +sources: + - git@git.sr.ht:~rbdr/map-linux +environment: + GPG_TTY: /dev/pts/0 +secrets: + - a1e0e3da-c1ad-473a-ad69-8878f267a628 + - 0b0d3e5e-fbdc-41d0-97ed-ee654fe797ff + - 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 + cargo binstall cargo-deb --no-confirm + - release: | + cd map-linux + make ci diff --git a/.build-x86_64.yml b/.build-x86_64.yml new file mode 100644 index 0000000..b46bab7 --- /dev/null +++ b/.build-x86_64.yml @@ -0,0 +1,37 @@ +image: archlinux +arch: x86_64 +packages: + - make + - minisign + - rsync + - coreutils + - clang + - lld + - rustup + - tar + - gzip + - gtk4 + - libadwaita + - gtksourceview5 + - gettext +sources: + - git@git.sr.ht:~rbdr/map-linux +environment: + GPG_TTY: /dev/pts/0 +secrets: + - a1e0e3da-c1ad-473a-ad69-8878f267a628 + - 0b0d3e5e-fbdc-41d0-97ed-ee654fe797ff + - 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 + cargo binstall cargo-deb --no-confirm + - release: | + cd map-linux + make ci @@ -3,3 +3,8 @@ *.mo builddir .flatpak-builder +./*.minisign +*.minisign +*.rpm +*.deb +*.tar.gz @@ -2,6 +2,10 @@ name = "map" version = "1.0.0" edition = "2024" +license = "AGPL-3.0-or-later" +description = "Wardley Map editor for linux" +homepage = "https://map.tranquil.systems/map-for-linux" +authors = ["Rubén Beltrán del Río <wmap@r.bdr.sh>"] [dependencies] cairo-rs = "0.21.5" @@ -1,6 +1,12 @@ profile := dev target = $(shell rustc -vV | grep host | awk '{print $$2}') -architectures := aarch64-unknown-linux-gnu +# Cargo outputs dev profile to 'debug' directory, not 'dev' +ifeq ($(profile),dev) +output_dir := debug +else +output_dir := $(profile) +endif +architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu app_name := map deploy_host := deploy@build.r.bdr.sh deploy_path := /srv/http/build.r.bdr.sh/$(app_name)-linux @@ -26,7 +32,7 @@ endif # Build ######################################################################## build: compile_translations prepare - @$(eval target_dir := ./target/$(target)/$(profile)/map) + @$(eval target_dir := ./target/$(target)/$(output_dir)/map) cargo build --profile $(profile) --target $(target) # Code Quality ################################################################# @@ -81,7 +87,7 @@ endif package-tar: build @$(eval staging := $(shell mktemp -d)) - @install -Dm0755 target/$(target)/$(profile)/$(app_name) $(staging)/usr/bin/$(app_name) + @install -Dm0755 target/$(target)/$(output_dir)/$(app_name) $(staging)/usr/bin/$(app_name) @install -Dm0644 resources/logo.svg $(staging)/usr/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg @install -Dm0644 resources/systems.tranquil.Map.desktop $(staging)/usr/share/applications/systems.tranquil.Map.desktop @install -Dm0644 resources/systems.tranquil.Map.metainfo.xml $(staging)/usr/share/metainfo/systems.tranquil.Map.metainfo.xml @@ -121,7 +127,7 @@ release: package distribute # Installation ################################################################# install: build - install -Dm0755 target/$(target)/$(profile)/$(app_name) $(prefix)/bin/$(app_name) + install -Dm0755 target/$(target)/$(output_dir)/$(app_name) $(prefix)/bin/$(app_name) install -Dm0644 resources/logo.svg $(prefix)/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg install -Dm0644 resources/systems.tranquil.Map.desktop $(prefix)/share/applications/systems.tranquil.Map.desktop install -Dm0644 resources/systems.tranquil.Map.metainfo.xml $(prefix)/share/metainfo/systems.tranquil.Map.metainfo.xml @@ -146,7 +152,7 @@ uninstall: # CI ########################################################################### -ci: lint coverage +ci: lint ifeq ($(GIT_REF),refs/heads/main) $(MAKE) -e profile=release -e channel=unstable $(architectures) else ifneq (,$(findstring refs/tags/,$(GIT_REF))) @@ -160,5 +166,11 @@ else $(MAKE) -e target=$@ build endif +release_all: +ifndef channel + $(error channel is required for release_all) +endif + $(MAKE) -e profile=release $(architectures) + -.PHONY: default build $(architectures) package package-rpm package-deb package-tar package-flatpak distribute distribute-rpm distribute-deb distribute-tar distribute-flatpak prepare set_rust ci release test coverage format update_flatpak_dependencies extract_strings find_translatable_files compile_translations install uninstall +.PHONY: default build $(architectures) package package-rpm package-deb package-tar package-flatpak distribute distribute-rpm distribute-deb distribute-tar distribute-flatpak prepare set_rust ci release release_all test coverage format update_flatpak_dependencies extract_strings find_translatable_files compile_translations install uninstall diff --git a/resources/systems.tranquil.Map.desktop b/resources/systems.tranquil.Map.desktop index f76d73a..c3b8a70 100644 --- a/resources/systems.tranquil.Map.desktop +++ b/resources/systems.tranquil.Map.desktop @@ -2,7 +2,7 @@ Type=Application Name=Map GenericName=Wardley Map Editor -Comment=Wardley Map Editor for Linux +Comment=Wardley Map editor for Linux Categories=GNOME;GTK;Graphics;Utility; Icon=systems.tranquil.Map Exec=map %u |