summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-07-09 18:11:48 -0400
committerLouie S <louie@example.com>2024-07-09 18:11:48 -0400
commit2705958dc6de68a487597e29d4b9b99ccc6724a0 (patch)
tree3aa0674f49d947a642749c85a1ca140d6bb9e76c /actions
parentaccd85087031fbfbd5759f42268597cf22d1a97f (diff)
Incorporate actions with build system
Diffstat (limited to 'actions')
-rw-r--r--actions/Makefile.am23
-rwxr-xr-xactions/build_deb.sh30
2 files changed, 23 insertions, 30 deletions
diff --git a/actions/Makefile.am b/actions/Makefile.am
new file mode 100644
index 0000000..a27b73d
--- /dev/null
+++ b/actions/Makefile.am
@@ -0,0 +1,23 @@
+DEBUILD_ARGS =
+SAVE_CONTAINER = no
+
+clean-local:
+ -rm -rf build/
+
+.PHONY: actions_build_deb
+actions_build_deb: IMAGE_NAME = debian
+actions_build_deb: IMAGE_VERSION = unstable
+actions_build_deb: CONTAINER_NAME = $(PACKAGE_NAME)_$@_$(IMAGE_NAME)-$(IMAGE_VERSION)
+actions_build_deb: DEPENDENCY_LIST = autoconf-archive debmake devscripts ncurses-dev pkg-config
+actions_build_deb: ../$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
+ podman pull docker.io/library/$(IMAGE_NAME):$(IMAGE_VERSION)
+ podman container exists "$(CONTAINER_NAME)" || podman run -itd --name "$(CONTAINER_NAME)" "$(IMAGE_NAME):$(IMAGE_VERSION)"
+ podman exec "$(CONTAINER_NAME)" mkdir -p /tmp/build
+ podman cp "../$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz" "$(CONTAINER_NAME)":/tmp/build
+ podman exec -w /tmp/build "$(CONTAINER_NAME)" apt-get -y update
+ podman exec -w /tmp/build "$(CONTAINER_NAME)" apt-get -y upgrade
+ podman exec -w /tmp/build "$(CONTAINER_NAME)" apt install -y $(DEPENDENCY_LIST)
+ podman exec -w /tmp/build "$(CONTAINER_NAME)" debmake -y -a $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz -i debuild $(DEBUILD_ARGS)
+ mkdir -p "build/$@/$(IMAGE_NAME)-$(IMAGE_VERSION)"
+ podman cp "$(CONTAINER_NAME)":/tmp/build/. "build/$@/$(IMAGE_NAME)-$(IMAGE_VERSION)/"
+ test "$(SAVE_CONTAINER)" = "no" && (podman kill "$(CONTAINER_NAME)" && podman rm "$(CONTAINER_NAME)")
diff --git a/actions/build_deb.sh b/actions/build_deb.sh
deleted file mode 100755
index 2055f6e..0000000
--- a/actions/build_deb.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env sh
-
-CONTAINER_NAME="build_deb"
-IMAGE_NAME="$1"
-
-DEPENDENCY_LIST="autoconf-archive debmake devscripts ncurses-dev pkg-config"
-
-if [ -z "$IMAGE_NAME" ]; then
- IMAGE_NAME="debian:unstable"
-fi
-
-podman pull docker.io/library/"$IMAGE_NAME"
-
-podman run -itd --name "$CONTAINER_NAME" "$IMAGE_NAME"
-
-make -C "$(dirname "$0")/.." dist
-podman exec "$CONTAINER_NAME" mkdir -p /tmp/build
-podman cp terminal-media-launcher*.tar.gz "$CONTAINER_NAME":/tmp/build
-
-podman exec -w /tmp/build "$CONTAINER_NAME" apt-get -y update
-podman exec -w /tmp/build "$CONTAINER_NAME" apt-get -y upgrade
-podman exec -w /tmp/build "$CONTAINER_NAME" apt install -y $DEPENDENCY_LIST
-podman exec -w /tmp/build "$CONTAINER_NAME" debmake -y -a terminal-media-launcher-0.1.tar.gz -i debuild
-
-mkdir -p "$(dirname "$0")/build"
-
-podman cp "$CONTAINER_NAME":/tmp/build/. "$(dirname "$0")/build/"
-
-podman kill "$CONTAINER_NAME"
-podman rm "$CONTAINER_NAME"