Skip to content

Commit be0d45e

Browse files
committed
Create .deb file and release it
1 parent 378058a commit be0d45e

1 file changed

Lines changed: 52 additions & 8 deletions

File tree

.github/workflows/downloads.sh

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,72 @@
33
set -e
44
set -u
55

6+
ORIGIN=$(pwd)
7+
TARGET=$ORIGIN/$1
8+
BUILD=$(mktemp -d)
9+
610
VERSION=${GITHUB_REF#refs/tags/v*}
7-
TARGET=$(pwd)/$1
811
SETUP=$TARGET/setup-${VERSION}.sh
912
ENTRYPOINT=$TARGET/xp-run-${VERSION}.sh
1013
TAR=$TARGET/xp-runners_${VERSION}.tar.gz
1114
ZIP=$TARGET/xp-runners_${VERSION}.zip
15+
DEB=$TARGET/xp-runners_${VERSION}-1_all.deb
1216

1317
mkdir -p $TARGET
14-
rm -rf $TAR $ZIP
18+
rm -rf $TAR $ZIP $DEB
1519

16-
# One-line installer
20+
echo "=> One-line installer"
1721
cat setup.sh.in | sed -e "s/@VERSION@/$VERSION/g" > $SETUP
1822

19-
# Shell entrypoint
23+
echo "=> Shell entrypoint"
2024
(cat xp-run.sh.in | sed -e "s/@VERSION@/$VERSION/g" ; cat class-main.php ) > $ENTRYPOINT
2125

22-
# Tar.gz for Un*x
26+
echo "=> Tar.gz for Un*x"
2327
tar cvfz $TAR xp.exe xar.exe tput.exe class-main.php web-main.php
2428

25-
# Zipfile for Windows
29+
echo "=> Zipfile for Windows"
2630
zip -j $ZIP xp.exe xar.exe tput.exe class-main.php web-main.php
2731

32+
echo "=> Debian package"
33+
fakeroot=$(which fakeroot || which fakeroot-ng)
34+
35+
# data.tar.xz
36+
mkdir -p $BUILD/usr/bin
37+
38+
printf '#!/bin/sh\nexec /usr/bin/mono /usr/bin/xp.exe "$@"\n' > $BUILD/usr/bin/xp
39+
chmod 755 $BUILD/usr/bin/xp
40+
41+
printf '#!/bin/sh\nexec /usr/bin/mono /usr/bin/xp.exe ar "$@"\n' > $BUILD/usr/bin/xar
42+
chmod 755 $BUILD/usr/bin/xar
43+
44+
cp xp.exe $BUILD/usr/bin/xp.exe
45+
cp class-main.php web-main.php $BUILD/usr/bin
46+
47+
cd $BUILD
48+
$fakeroot tar cfJ data.tar.xz usr/bin/*
49+
50+
# control.tar.gz
51+
size=$(du -k usr/bin | cut -f 1)
52+
echo -n '' > conffiles
53+
cat <<-EOF > control
54+
Package: xp-runners
55+
Priority: extra
56+
Section: devel
57+
Installed-Size: ${size}
58+
Maintainer: XP Team <xp-runners@xp-framework.net>
59+
Architecture: all
60+
Version: ${VERSION}-1
61+
Depends: php8.4-cli | php8.3-cli | php8.2-cli | php8.1-cli | php8.0-cli | php7.4-cli, libmono-corlib4.5-cil, libmono-system-core4.0-cil, libmono-system-runtime-serialization4.0-cil
62+
Provides: xp-runners
63+
Description: XP Runners
64+
EOF
65+
$fakeroot tar cfz control.tar.gz ./conffiles ./control
66+
cat control
67+
68+
echo '2.0' > debian-binary
69+
ar -q $DEB debian-binary control.tar.gz data.tar.xz
70+
cd $ORIGIN
71+
2872
# Done
29-
echo "Downloads"
30-
ls -al $SETUP $ENTRYPOINT $TAR $ZIP
73+
echo "=> Downloads"
74+
ls -al $SETUP $ENTRYPOINT $TAR $ZIP $DEB

0 commit comments

Comments
 (0)