action-debian-package/main.sh

48 lines
814 B
Bash
Raw Normal View History

2020-03-25 22:13:26 +00:00
#!/bin/sh
set -e
2020-03-25 23:28:59 +00:00
directory="$PWD/${INPUT_DIRECTORY}"
2020-03-25 22:13:26 +00:00
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/')"
2020-03-25 23:28:59 +00:00
container="$package_$version"
2020-03-25 22:13:26 +00:00
image="$os:$distribution"
docker create \
2020-03-25 23:28:59 +00:00
--tty \
2020-03-25 22:13:26 +00:00
--name "$container" \
2020-03-25 23:28:59 +00:00
--volume "$directory":"$directory" \
--workdir "$directory" \
2020-03-25 22:13:26 +00:00
"$image" \
sleep inf
2020-03-25 22:34:04 +00:00
docker start \
"$container"
2020-03-25 23:42:28 +00:00
echo
docker exec $container pwd
echo
exit
2020-03-25 22:13:26 +00:00
docker exec \
"$container" \
apt-get update
docker exec \
"$container" \
2020-03-25 23:16:55 +00:00
apt-get install -y dpkg-dev debhelper
2020-03-25 22:13:26 +00:00
docker exec \
"$container" \
2020-03-25 23:34:51 +00:00
apt-get build-dep ./
2020-03-25 22:13:26 +00:00
docker exec \
"$container" \
dpkg-buildpackage -S -us -uc