test-action-debian-package/main.sh
2020-03-26 00:28:59 +01:00

43 lines
781 B
Bash
Executable file

#!/bin/sh
set -e
directory="$PWD/${INPUT_DIRECTORY}"
os="${INPUT_OS:-"debian"}"
cd "$directory"
package="$(dpkg-parsechangelog -S Source)"
version="$(dpkg-parsechangelog -S Version)"
distribution="$(dpkg-parsechangelog -S Distribution | sed 's/UNRELEASED/unstable/')"
container="$package_$version"
image="$os:$distribution"
docker create \
--tty \
--name "$container" \
--volume "$directory":"$directory" \
--workdir "$directory" \
"$image" \
sleep inf
docker start \
"$container"
docker exec \
"$container" \
apt-get update
docker exec \
"$container" \
apt-get install -y dpkg-dev debhelper
docker exec \
"$container" \
apt-get build-dep "$directory"
docker exec \
"$container" \
dpkg-buildpackage -S -us -uc