28 lines
827 B
Bash
Executable File
28 lines
827 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
# Apple container CLI on macOS, Docker CE on Linux.
|
|
case "$(uname -s)" in
|
|
Darwin) CONTAINER_RUNTIME=container ;;
|
|
Linux) CONTAINER_RUNTIME=docker ;;
|
|
*) printf 'ERROR: unsupported platform %s\n' "$(uname -s)" >&2; exit 1 ;;
|
|
esac
|
|
|
|
changelog_field() {
|
|
$CONTAINER_RUNTIME run --rm -v "$(pwd):/mnt" vpn-router-builder \
|
|
dpkg-parsechangelog --show-field "$1" -l /mnt/debian/changelog
|
|
}
|
|
|
|
VERSION="$(changelog_field Version)"
|
|
PACKAGE="$(changelog_field Source)"
|
|
DEB="out/${PACKAGE}_${VERSION}_all.deb"
|
|
|
|
if [ ! -f "$DEB" ]; then
|
|
printf 'ERROR: %s does not exist. Run ./build.sh first.\n' "$DEB" >&2
|
|
exit 1
|
|
fi
|
|
|
|
curl -v --user "slawek:$(cat ~/.gitea-packages-token)" \
|
|
--upload-file "$DEB" \
|
|
"https://gitea.koszewscy.waw.pl/api/packages/slawek/debian/pool/noble/main/upload"
|