aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile204
-rw-r--r--README.md85
-rw-r--r--justfile222
-rwxr-xr-xscripts/build_appimage.sh4
-rwxr-xr-xscripts/build_arch.sh4
-rwxr-xr-xscripts/build_deb.sh4
-rwxr-xr-xscripts/build_rpm.sh4
-rwxr-xr-xscripts/sign.sh18
-rwxr-xr-xscripts/sync_versions.sh20
10 files changed, 270 insertions, 296 deletions
diff --git a/.gitignore b/.gitignore
index f4abd0c..055982d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
builddir
vendor
_build
+_dist
dist
src/info.rs
.flatpak-builder
diff --git a/Makefile b/Makefile
deleted file mode 100644
index d3be667..0000000
--- a/Makefile
+++ /dev/null
@@ -1,204 +0,0 @@
-profile := dev
-target = $(shell rustc -vV | grep host | awk '{print $$2}')
-channel := unstable
-
-# Config: Directories & Locations ##############################################
-# Cargo outputs dev profile to 'debug' directory, not 'dev'
-prefix := /usr/local
-ifeq ($(profile),dev)
-output_dir := debug
-else
-output_dir := $(profile)
-endif
-flatpak_cargo_generator := $(HOME)/projects/vendor/flatpak-builder-tools/cargo
-
-# Config: Packaging Config #####################################################
-linuxdeploy_url := https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$(shell uname -m).AppImage
-linuxdeploy := .cache/linuxdeploy.AppImage
-pkgver := $(shell grep '^pkgver=' build-aux/arch/PKGBUILD | cut -d= -f2)
-pkgrel := $(shell grep '^pkgrel=' build-aux/arch/PKGBUILD | cut -d= -f2)
-
-# Filename format: map-aarch64-unstable.flatpak or map-aarch64-unstable-fedora43.rpm
-filename = $(app_name)-$(arch)-$(channel)
-
-# Config: Naming ###############################################################
-arch = $(firstword $(subst -, ,$(target)))
-app_name := map
-
-# Config: Container Images #####################################################
-fedora_versions := fedora43 fedora44 fedora-rawhide
-debian_versions := trixie forky
-all_containers := arch $(fedora_versions) $(debian_versions)
-container_image_prefix := map-build
-clean_images := 0
-
-# Config: Release Location #####################################################
-deploy_host := deploy@build.r.bdr.sh
-deploy_path := /srv/http/build.r.bdr.sh/$(app_name)-linux
-
-define sign_and_deploy
- @./scripts/sign.sh "$(1)" "$(channel)" "$(arch)"
- rsync -avz $(1) $(deploy_host):$(deploy_path)
- rsync -avz $(1).minisig $(deploy_host):$(deploy_path)
-endef
-
-# Container Images #############################################################
-
-build-container-%:
-ifeq ($(clean_images),1)
- podman system prune -af
-endif
- @echo "=== Building container image: $(container_image_prefix):$* ==="
- podman build -t $(container_image_prefix):$* build-containers/$*
-
-build-containers: $(addprefix build-container-,$(all_containers))
-
-# Packaging ####################################################################
-
-
-# Generic packages
-# These run directly on the host machine, since the assumption is that it
-# shouldn't affect the outcome.
-
-update_flatpak_dependencies:
- cd $(flatpak_cargo_generator) && `poetry env activate` && python3 flatpak-cargo-generator.py $(CURDIR)/Cargo.lock -o $(CURDIR)/build-aux/flatpak/cargo-sources.json && deactivate
-
-package-flatpak: update_flatpak_dependencies
- flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/flatpak/systems.tranquil.Map.yml
- flatpak build-bundle repo dist/$(filename).flatpak systems.tranquil.Map
-
-$(linuxdeploy):
- @mkdir -p .cache
- curl -L -o $(linuxdeploy) $(linuxdeploy_url)
- chmod +x $(linuxdeploy)
-
-package-appimage: $(linuxdeploy)
-ifeq ($(findstring linux,$(target)),linux)
- $(MAKE) build-container-trixie
- @echo "=== Building AppImage ==="
- ./scripts/build_appimage.sh $(container_image_prefix) trixie $(app_name) $(arch) $(channel) $(linuxdeploy)
-ifeq ($(clean_images),1)
- podman rmi $(container_image_prefix):trixie
-endif
-endif
-
-# Distro-specific packages
-# These run inside containers, as we want to make sure they're built with the
-# libraries available in that particular distribution.
-
-package-arch: build-container-arch
- @echo "=== Building Arch package for $(arch) ==="
- ./scripts/build_arch.sh $(container_image_prefix) arch $(app_name) $(arch) $(channel)
-ifeq ($(clean_images),1)
- podman rmi $(container_image_prefix):arch
-endif
-
-package-rpm:
-ifndef distro
- $(error distro is required, e.g., make package-rpm distro=fedora43)
-endif
- $(MAKE) build-container-$(distro)
- @echo "=== Building RPM for $(distro) ($(arch)) ==="
- ./scripts/build_rpm.sh $(container_image_prefix) $(distro) $(app_name) $(arch) $(channel)
-ifeq ($(clean_images),1)
- podman rmi $(container_image_prefix):$(distro)
-endif
-
-package-deb:
-ifndef distro
- $(error distro is required, e.g., make package-deb distro=trixie)
-endif
- $(MAKE) build-container-$(distro)
- @echo "=== Building DEB for $(distro) ($(arch)) ==="
- ./scripts/build_deb.sh $(container_image_prefix) $(distro) $(app_name) $(arch) $(channel)
-ifeq ($(clean_images),1)
- podman rmi $(container_image_prefix):$(distro)
-endif
-
-package-rpm-all:
- @for v in $(fedora_versions); do \
- $(MAKE) distro=$$v package-rpm; \
- done
-
-package-deb-all:
- @for v in $(debian_versions); do \
- $(MAKE) distro=$$v package-deb; \
- done
-
-package: package-tar package-flatpak package-appimage package-arch package-rpm-all package-deb-all
-
-# Distribution #################################################################
-
-distribute-flatpak:
- @$(call sign_and_deploy,$(filename).flatpak)
-
-distribute-appimage:
- @$(call sign_and_deploy,$(filename).AppImage)
-
-distribute-pacman:
- @$(call sign_and_deploy,$(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz)
-
-distribute-rpm:
- @for v in $(fedora_versions); do \
- ./scripts/sign.sh "$(filename)-$$v.rpm" "$(channel)" "$(arch)" && \
- rsync -avz $(filename)-$$v.rpm $(deploy_host):$(deploy_path) && \
- rsync -avz $(filename)-$$v.rpm.minisig $(deploy_host):$(deploy_path); \
- done
-
-distribute-deb:
- @for v in $(debian_versions); do \
- ./scripts/sign.sh "$(filename)-$$v.deb" "$(channel)" "$(arch)" && \
- rsync -avz $(filename)-$$v.deb $(deploy_host):$(deploy_path) && \
- rsync -avz $(filename)-$$v.deb.minisig $(deploy_host):$(deploy_path); \
- done
-
-distribute: distribute-tar distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb
-
-# Release ######################################################################
-
-release:
- $(MAKE) profile=release package distribute
-
-# Installation #################################################################
-
-install: build
- 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
- install -Dm0644 resources/systems.tranquil.Map.service $(prefix)/share/dbus-1/services/systems.tranquil.Map.service
- install -Dm0644 resources/wmap.lang $(prefix)/share/gtksourceview-5/language-specs/wmap.lang
- @for po_file in po/*.po; do \
- locale=$$(basename "$$po_file" .po); \
- install -Dm0644 po/$$locale/LC_MESSAGES/systems.tranquil.Map.mo $(prefix)/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \
- done
-
-uninstall:
- rm -f $(prefix)/bin/$(app_name)
- rm -f $(prefix)/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg
- rm -f $(prefix)/share/applications/systems.tranquil.Map.desktop
- rm -f $(prefix)/share/metainfo/systems.tranquil.Map.metainfo.xml
- rm -f $(prefix)/share/dbus-1/services/systems.tranquil.Map.service
- rm -f $(prefix)/share/gtksourceview-5/language-specs/wmap.lang
- @for po_file in po/*.po; do \
- locale=$$(basename "$$po_file" .po); \
- rm -f $(prefix)/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \
- done
-
-ci: lint
-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 \
- update_flatpak_dependencies \
- package-flatpak package-appimage \
- package-arch package-rpm package-deb \
- package-rpm-all package-deb-all package \
- distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb distribute \
- release install uninstall \
- build-containers
diff --git a/README.md b/README.md
index 19b1b2d..64c4582 100644
--- a/README.md
+++ b/README.md
@@ -4,69 +4,92 @@ A wardley mapping tool for linux: Write some text, get a diagram.
## Building
-For default settings, `just build`
+### Dependencies
-This project uses meson and ninja on top of the rust tools.
+This project uses the following:
-1. Run `meson setup _build`
+* `rust`, the language the project is written in. Required. >= 1.92.
+* `meson`, the build system used to compile everything. Required. >= 1.0.0
+* `gettext`, the tooling to compile translations. Required. >= 1.0.0
+* `just` to run tasks. Recommended if you plan on doing anything more complex
+ than compiling.
+* `appstream-util`, work with and validate appstream. Required.
+* `desktop-file-utils`, work with and validate desktop file. Required.
+* You will need the development libraries for `glib-2.0 >= 2.84.0`,
+ `gio-2.0 >= 2.84.0`, `gtk4 >= 4.18.0`, `libadwaita-1 >= 1.7.0`,
+ `gtksourceview-5 >= 5.16.0`.
+* `podman`, if you plan on building appimage, rpm, deb, or arch packages.
-## Installing
+### Compiling
+
+For default settings useful for development, `just build`
+
+### Installing
For a quick local install without packaging:
-* `make install` - installs to `/usr/local` (may require sudo)
-* `make uninstall` - removes installed files
+* `just install` - installs using meson's install command. Might require `sudo`.
+* `just uninstall` - removes installed files
-To install to a different prefix: `make install prefix=/opt/map`
+To install to a different prefix: `just install prefix=/opt/map`
-## Testing
+## Code Quality
-Run `make test`
+### Testing
-## Formatting and Linting
+Run `just test`
-* To format: `make format`
-* To lint: `make lint`
+### Formatting and Linting
+
+* To format: `just format`
+* To lint: `just lint`
## Notes for Developers.
-`meson.build` is the source of truth for the version. A script will update all
-other sources to make sure they're in sync.
+`meson.build` is the source of truth for the version. To sync versions to
+Cargo.toml, rpm spec, etc. use `just sync-versions`
## Distributing
-Available package formats: deb, rpm, tar.gz, flatpak
+Available package formats: deb, rpm, tar.gz, flatpak.
### Main Targets
-* `make package` - creates all package types for the current architecture (no upload)
-* `make distribute` - signs and uploads existing packages
-* `make release` - full workflow (package + distribute)
+* `just package` - creates all package types for the current architecture (no upload)
+* `just distribute` - signs and uploads existing packages
+* `just release` - full workflow (package + distribute)
### Individual Targets
For more control, use individual package or distribute targets:
-* `make package-deb` - create .deb package
-* `make package-rpm` - create .rpm package
-* `make package-tar` - create .tar.gz archive
-* `make package-flatpak` - create .flatpak bundle
+* `just package-deb-all` - create .deb packages
+* `just package-rpm-all` - create .rpm packages
+* `just package-arch` - create .pkg.tar.gz package
+* `just package-appimage` - create .AppImage archive
+* `just package-flatpak` - create .flatpak bundle
+
+* `just distribute-deb-all` - sign and upload .deb
+* `just distribute-rpm-all` - sign and upload .rpm
+* `just distribute-arch` - sign and upload .pkg.tar.gz package
+* `just distribute-appimage` - sign and upload .AppImage
+* `just distribute-flatpak` - sign and upload .flatpak
-* `make distribute-deb` - sign and upload .deb
-* `make distribute-rpm` - sign and upload .rpm
-* `make distribute-tar` - sign and upload .tar.gz
-* `make distribute-flatpak` - sign and upload .flatpak
+For `.deb` targets we build for `trixie` and `forky`, while for `.rpm` targets
+we build for `fedora43`, `fedora44`, and `fedora-rawhide`. You can build
+individual packages by running `just package-deb DISTRO` or
+`just package-rpm DISTRO`
### Flatpak Notes
Since flatpak expects offline building, we use `flatpak-cargo-generator` to
-generate the sources. This will be done every time you run `make package-flatpak`.
+generate the sources. This will be done every time you run `just package-flatpak`.
The project assumes `flatpak-cargo-generator.py` lives in
`~/projects/vendor/flatpak-builder-tools/cargo`, but you can override this with
-the environment variable `flatpak_cargo_generator` (eg.
-`make -e flatpak_cargo_generator=~/your/path/to/flatpak_cargo_generator`). It
-expects this directory to have the poetry configuration, as it enables the
+the variable `flatpak_cargo_generator` (eg.
+`just flatpak_cargo_generator=~/your/path/to/flatpak_cargo_generator package-flatpak`
+). It expects this directory to have the poetry configuration, as it enables the
virtualenv using poetry.
## Localization / Internationalization
@@ -75,7 +98,7 @@ This project uses gettext for translations. You can update the template files
with:
```
-make extract_strings
+just extract_strings
```
This updates the available POTFILES by checking for the presence of the tr!
diff --git a/justfile b/justfile
index e87f5c0..fc49f8b 100644
--- a/justfile
+++ b/justfile
@@ -1,42 +1,242 @@
+# Configuration ################################################################
+app_name := "map"
+channel := "unstable"
+builddir := "_build"
+distdir := "_dist"
+clean_images := ""
+
+# Derived Values ---------------------------------------------------------------
+target := `rustc -vV | grep host | awk '{print $2}'`
+arch := replace_regex(target, "-.*$", "")
+filename := f"{{app_name}}-{{arch}}-{{channel}}"
+
+# Packaging --------------------------------------------------------------------
+linuxdeploy_url := "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-" + `uname -m` + ".AppImage"
+linuxdeploy := ".cache/linuxdeploy.AppImage"
+flatpak_cargo_generator := home_directory() / "projects/vendor/flatpak-builder-tools/cargo"
+
+# Build Containers -------------------------------------------------------------
+fedora_versions := "fedora43 fedora44 fedora-rawhide"
+debian_versions := "trixie forky"
+appimage_container := "trixie"
+all_containers := f"arch {{fedora_versions}} {{debian_versions}}"
+container_image_prefix := "map-build"
+
+# Distribution Hosts -----------------------------------------------------------
+distribution_host := "deploy@build.r.bdr.sh"
+distribution_path := f"/srv/http/build.r.bdr.sh/{{app_name}}-linux"
+
# Build ########################################################################
+
+# Setup the meson build directory.
setup:
- meson setup _build
+ meson setup {{builddir}}
+# Compile the project using meson
build: setup
- meson compile -C _build
+ meson compile -C {{builddir}}
+# Create a dist tarball with meson
dist: setup
- meson dist -C _build --no-tests --allow-dirty
+ meson dist -C {{builddir}} --no-tests --allow-dirty
# Code Quality #################################################################
+# Run tests
test:
- cargo test
+ cargo test
+# Run tests with a coverage report
coverage:
- cargo tarpaulin
+ cargo tarpaulin
+# Format the source code and fix fixable code quality issues
format:
- cargo fmt && cargo clippy --fix
+ cargo fmt && cargo clippy --fix
+# Check the source code for lint and code quality issues
lint:
- cargo fmt -- --check && cargo clippy
+ cargo fmt -- --check && cargo clippy
# Internationalization / Localization ##########################################
-# Finds all files that can be translated and adds them to the POTFILES
+# Find translatable strings in the source and create a reference in POTFILES
find_translatable_files:
- find ./src -not -path '*/.*' -type f -name "*.rs" -exec grep -l "tr!(\"\|gettext" {} \; | sed 's|^\./||' | sort > po/POTFILES
- find ./data -not -path '*/.*' -name "*.in.in" -type f | sed 's|^\./||' | sort >> po/POTFILES
+ find ./src -not -path '*/.*' -type f -name "*.rs" -exec grep -l "tr!(\"\|gettext" {} \; | sed 's|^\./||' | sort > po/POTFILES
+ find ./data -not -path '*/.*' -name "*.in.in" -type f | sed 's|^\./||' | sort >> po/POTFILES
+# Extract the strings into the POT file
extract_strings: find_translatable_files
- @xgettext --files-from=po/POTFILES --output=po/systems.tranquil.Map.pot --from-code=UTF-8 --add-comments --keyword='tr!'
+ xgettext --files-from=po/POTFILES --output=po/systems.tranquil.Map.pot --from-code=UTF-8 --add-comments --keyword='tr!'
+
+# Containers ###################################################################
+
+# Builds the container specified by name
+build-container name:
+ {{ if clean_images != "" { "podman system prune -af" } else { "" } }}
+ @echo "=== Building container image: {{container_image_prefix}}:{{name}} ==="
+ podman build -t {{container_image_prefix}}:{{name}} build-containers/{{name}}
+
+# Builds all containers
+build-containers:
+ for container in {{all_containers}}; do just build-container "$container"; done
+
+# Packaging ####################################################################
+
+# Updates the cargo-sources.json
+update_flatpak_dependencies:
+ cd {{flatpak_cargo_generator}} && `poetry env activate` && python3 flatpak-cargo-generator.py {{justfile_directory()}}/Cargo.lock -o {{justfile_directory()}}/build-aux/flatpak/cargo-sources.json && deactivate
+
+# Builds a flatpak and exports the .flatpak file
+package-flatpak: _ensure_distdir update_flatpak_dependencies
+ flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/flatpak/systems.tranquil.Map.yml
+ flatpak build-bundle repo {{distdir}}/{{filename}}.flatpak systems.tranquil.Map
+
+_fetch-linuxdeploy:
+ @mkdir -p .cache
+ @test -f {{linuxdeploy}} || curl -L -o {{linuxdeploy}} {{linuxdeploy_url}}
+ @chmod +x {{linuxdeploy}}
+
+# Builds an AppImage
+package-appimage: _ensure_distdir (build-container appimage_container) _fetch-linuxdeploy && (_clean_image appimage_container)
+ @echo "=== Building AppImage ==="
+ ./scripts/build_appimage.sh {{container_image_prefix}} trixie {{app_name}} {{arch}} {{channel}} {{linuxdeploy}}
+
+# Builds an arch .pkg.tar.gz
+package-arch: _ensure_distdir (build-container "arch") dist && (_clean_image "arch")
+ @echo "=== Building Arch package ({{arch}}) ==="
+ ./scripts/build_arch.sh {{container_image_prefix}} arch {{app_name}} {{arch}} {{channel}}
+
+# Build .rpm for the given distro
+package-rpm distro: _ensure_distdir (build-container distro) dist && (_clean_image distro)
+ @echo "=== Building RPM for {{distro}} ({{arch}}) ==="
+ ./scripts/build_rpm.sh {{container_image_prefix}} {{distro}} {{app_name}} {{arch}} {{channel}}
+
+# Build .deb for the given distro
+package-deb distro: _ensure_distdir (build-container distro) dist && (_clean_image distro)
+ @echo "=== Building DEB for {{distro}} ({{arch}}) ==="
+ ./scripts/build_deb.sh {{container_image_prefix}} {{distro}} {{app_name}} {{arch}} {{channel}}
+
+# Build .rpm for every supported distro
+package-rpm-all:
+ for distro in {{fedora_versions}}; do just package-rpm "$distro"; done
+
+# Build .deb for every supported distro
+package-deb-all:
+ for distro in {{debian_versions}}; do just package-deb "$distro"; done
+
+# Build all distributable packages
+package: package-flatpak package-appimage package-arch package-rpm-all package-deb-all
+
+# Distribution #################################################################
+
+# Sign and upload flatpak
+distribute-flatpak: (_sign_and_upload f"{{distdir}}/{{filename}}.flatpak")
+
+# Sign and upload AppImage
+distribute-appimage: (_sign_and_upload f"{{distdir}}/{{filename}}.AppImage")
+# Sign and upload arch .pkg.tar.gz
+distribute-arch: (_sign_and_upload f"{{distdir}}/{{filename}}-arch.pkg.tar.gz")
+
+# Sign and upload .rpm files
+distribute-rpm:
+ for distro in {{fedora_versions}}; do just _distribute-rpm "$distro"; done
+
+# Sign and upload .deb files
+distribute-deb:
+ for distro in {{debian_versions}}; do just _distribute-deb "$distro"; done
+
+# Sign and upload all distributable packages
+distribute: distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb
+
+_distribute-rpm distro: (_sign_and_upload f"{{distdir}}/{{filename}}-{{distro}}.rpm")
+
+_distribute-deb distro: (_sign_and_upload f"{{distdir}}/{{filename}}-{{distro}}.deb")
+
+# Release ######################################################################
+
+# Creates, signs and uploads all distributable packages
+release: package distribute
+
+# CI/CD ########################################################################
+
+# Intended to run in CI. Lints and releases.
+ci: lint
+ #!/usr/bin/env bash
+ if [[ "$GIT_REF" == "refs/heads/main"]]; then
+ just release
+ elif [[ "$GIT_REF" == "refs/tags/*" ]]; then
+ just channel="${GIT_REF#refs/tags/}" release
+ else
+ echo "Not in CI environment."
+ fi
+
+# Local Install ################################################################
+
+# Locally installs
+install: build
+ meson install -C {{builddir}}
+
+uninstall:
+ ninja -C {{builddir}} uninstall
# Utility Tasks ################################################################
+
+# Print the Version
version:
@grep -m1 -o "[^_]version: '[^']*'" meson.build | awk -F"'" '{print $2}'
+# Vendor the rust dependencies
vendor location:
cargo vendor {{location}} >/dev/null
mkdir -p .cargo
+
+# Syncs versions of different files to the meson.build
+sync-versions:
+ #!/usr/bin/env bash
+ version=`just version`
+ echo "Using version from meson.build: ${version}"
+
+ # Rust Cargo.toml
+ echo -ne "\tUpdating: Cargo.toml"
+ sed -i "s/^version = \"[^\"]*\"$/version = \"$version\"/" Cargo.toml
+ echo -e "\r\tUpdated: Cargo.toml "
+
+ # Arch PKGBUILD
+ echo -ne "\tUpdating: PKGBUILD"
+ sed -i "s/^pkgver=.*$/pkgver=$version/" build-aux/arch/PKGBUILD
+ echo -e "\r\tUpdated: PKGBUILD "
+
+ # Fedora RPM Spec
+ echo -ne "\tUpdating: map.spec"
+ sed -i "s/^Version: .*$/Version: $version/" build-aux/rpm/map.spec
+ echo -e "\r\tUpdated: map.spec "
+
+# Internal Tasks ###############################################################
+
+# Cleans images if the flag is set (eg. for low-storage environments)
+_clean_image image:
+ {{ if clean_images != "" { f"podman rmi {{container_image_prefix}}:{{image}}" } else { "" } }}
+
+# Ensures distdir exists
+_ensure_distdir:
+ @mkdir -p {{distdir}}
+
+# Signs a file
+_sign file version platform:
+ #!/usr/bin/env bash
+ comment="Version: {{version}}, File: {{file_name(file)}} Built on: {{datetime('%Y-%m-%d %H:%M')}}, Platform: {{platform}}"
+ if [ -f ~/.minisign/minisign.pass ]; then
+ cat ~/.minisign/minisign.pass | minisign -Sm "{{file}}" -t "${comment}"
+ else
+ minisign -Sm "{{file}}" -t "${comment}"
+ fi
+
+# Uploads a file and its signature.
+_upload file:
+ rsync -avz {{file}}.minisig {{distribution_host}}:{{distribution_path}}
+ rsync -avz {{file}} {{distribution_host}}:{{distribution_path}}
+
+# Sign and upload a file.
+_sign_and_upload file: (_sign file channel arch) (_upload file)
diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh
index d39f506..b409961 100755
--- a/scripts/build_appimage.sh
+++ b/scripts/build_appimage.sh
@@ -12,7 +12,6 @@ linuxdeploy=$6
version=`just version`
staging="$(mktemp -d)"
-just dist
tar -xJf "_build/meson-dist/map-${version}.tar.xz" -C "${staging}/"
cp ${linuxdeploy} "${staging}/linuxdeploy.AppImage"
@@ -32,6 +31,5 @@ podman run --rm -v "${staging}:/build:Z" \
mv /build/Map*.AppImage /build/out/
"
-mkdir -p dist
-mv ${staging}/out/*.AppImage "dist/${app_name}-${arch}-${channel}.AppImage"
+mv ${staging}/out/*.AppImage "_dist/${app_name}-${arch}-${channel}.AppImage"
rm -rf "${staging}"
diff --git a/scripts/build_arch.sh b/scripts/build_arch.sh
index 602b31d..c4a3c0c 100755
--- a/scripts/build_arch.sh
+++ b/scripts/build_arch.sh
@@ -11,7 +11,6 @@ channel=$5
version=`just version`
staging="$(mktemp -d)"
-just dist
cp _build/meson-dist/map-${version}.tar.xz "${staging}/"
cp build-aux/arch/PKGBUILD "${staging}/"
@@ -28,6 +27,5 @@ podman run --rm -v "${staging}:/build:Z" \
cp /tmp/pkg/map-${version}-1-${arch}.pkg.tar.gz /build/out/
"
-mkdir -p dist
-cp ${staging}/out/*.pkg.tar.gz "dist/${app_name}-${arch}-${channel}-${distro}.pkg.tar.gz"
+cp ${staging}/out/*.pkg.tar.gz "_dist/${app_name}-${arch}-${channel}-${distro}.pkg.tar.gz"
rm -rf "${staging}"
diff --git a/scripts/build_deb.sh b/scripts/build_deb.sh
index 66b51fa..d7f978b 100755
--- a/scripts/build_deb.sh
+++ b/scripts/build_deb.sh
@@ -11,7 +11,6 @@ channel=$5
version=`just version`
staging="$(mktemp -d)"
-just dist
cp _build/meson-dist/map-${version}.tar.xz "${staging}/${app_name}_${version}.orig.tar.xz"
tar -xJf "${staging}/${app_name}_${version}.orig.tar.xz" -C "${staging}"
mkdir -p ${staging}/${app_name}-${version}
@@ -26,6 +25,5 @@ podman run --rm -v "${staging}:/build:Z" \
cp /build/${app_name}_${version}*_*.deb /build/out/
"
-mkdir -p dist
-cp ${staging}/out/*.deb "dist/${app_name}-${arch}-${channel}-${distro}.deb"
+cp ${staging}/out/*.deb "_dist/${app_name}-${arch}-${channel}-${distro}.deb"
rm -rf "${staging}"
diff --git a/scripts/build_rpm.sh b/scripts/build_rpm.sh
index efffef3..ac2510d 100755
--- a/scripts/build_rpm.sh
+++ b/scripts/build_rpm.sh
@@ -11,7 +11,6 @@ channel=$5
version=`just version`
staging="$(mktemp -d)"
-just dist
cp _build/meson-dist/map-${version}.tar.xz "${staging}/"
just vendor "${staging}/vendor"
@@ -31,6 +30,5 @@ podman run --rm -v "${staging}:/build:Z" \
cp ~/rpmbuild/RPMS/${arch}/map-${version}-1.*.rpm /build/out/
"
-mkdir -p dist
-cp ${staging}/out/*.rpm "dist/${app_name}-${arch}-${channel}-${distro}.rpm"
+cp ${staging}/out/*.rpm "_dist/${app_name}-${arch}-${channel}-${distro}.rpm"
rm -rf "${staging}"
diff --git a/scripts/sign.sh b/scripts/sign.sh
deleted file mode 100755
index b3bfe47..0000000
--- a/scripts/sign.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-
-set +x
-if [ $# -ne 3 ]; then
- echo "Usage: $0 <file> <channel> <architecture>"
- exit 1
-fi
-
-FILE="$1"
-VERSION="$2"
-PLATFORM="$3"
-COMMENT="Version: ${VERSION}, File: $(basename ${FILE}) Built on: $(date +'%Y-%m-%d %H:%M'), Platform: ${PLATFORM}"
-
-if [ -f ~/.minisign/minisign.pass ]; then
- cat ~/.minisign/minisign.pass | minisign -Sm "${FILE}" -t "${COMMENT}"
-else
- minisign -Sm "${FILE}" -t "${COMMENT}"
-fi
diff --git a/scripts/sync_versions.sh b/scripts/sync_versions.sh
deleted file mode 100755
index f3955ef..0000000
--- a/scripts/sync_versions.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-
-version=`just version`
-
-echo "Using version from meson.build: ${version}"
-
-# Rust Cargo.toml
-echo -ne "\tUpdating: Cargo.toml"
-sed -i "s/^version = \"[^\"]*\"$/version = \"$version\"/" Cargo.toml
-echo -e "\r\tUpdated: Cargo.toml "
-
-# Arch PKGBUILD
-echo -ne "\tUpdating: PKGBUILD"
-sed -i "s/^pkgver=.*$/pkgver=$version/" build-aux/arch/PKGBUILD
-echo -e "\r\tUpdated: PKGBUILD "
-
-# Fedora RPM Spec
-echo -ne "\tUpdating: map.spec"
-sed -i "s/^Version: .*$/Version: $version/" build-aux/rpm/map.spec
-echo -e "\r\tUpdated: map.spec "