test-action-debian-package/main.sh
Dawid Dziurla 9e6ff7644d
main: test
2020-03-26 00:44:45 +01:00

48 lines
818 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"
echo
docker exec $container ls -lha
echo
exit
docker exec \
"$container" \
apt-get update
docker exec \
"$container" \
apt-get install -y dpkg-dev debhelper
docker exec \
"$container" \
apt-get build-dep ./
docker exec \
"$container" \
dpkg-buildpackage -S -us -uc