-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish-os-packages
executable file
·47 lines (37 loc) · 1.54 KB
/
publish-os-packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -eo pipefail
npm install
npx tsc
npx pkg . --public -t node16-linux-x64 -o pkg/linux/gitte && gzip -c pkg/linux/gitte > pkg/linux.gz
npx pkg . --public -t node16-macos-x64 -o pkg/macos/gitte && gzip -c pkg/macos/gitte > pkg/macos.gz
npx pkg . --public -t node16-win-x64 -o pkg/win/gitte && gzip -c pkg/win/gitte.exe > pkg/win.gz
VERSION=$(jq -r ".version" < package.json)
DESCRIPTION=$(jq -r ".description" < package.json)
rm -rf "pkg/gitte_${VERSION}_amd64"
mkdir -p ppa
# Generate package info file
mkdir -p "pkg/gitte_${VERSION}_amd64/DEBIAN/"
cat << EOF > "pkg/gitte_${VERSION}_amd64/DEBIAN/control"
Name: gitte
Package: gitte
Version: ${VERSION}
Architecture: amd64
Author: Cego A/S <[email protected]>
Maintainer: Cego A/S <[email protected]>
Description: ${DESCRIPTION}
Homepage: https://github.com/cego/gitte
Website: https://github.com/cego/gitte
EOF
mkdir -p "pkg/gitte_${VERSION}_amd64/usr/local/bin/"
cp pkg/linux/gitte "pkg/gitte_${VERSION}_amd64/usr/local/bin/"
(cd pkg/ && (dpkg-deb --root-owner-group --build "gitte_${VERSION}_amd64" || rm "pkg/gitte_${VERSION}_amd64.deb"))
mv "pkg/gitte_${VERSION}_amd64.deb" "ppa/"
# Packages & Packages.gz
(cd ppa && dpkg-scanpackages --multiversion . > Packages)
(cd ppa && gzip -k -f Packages)
# Release, Release.gpg & InRelease
(cd ppa && apt-ftparchive release . > Release)
(cd ppa && gpg --default-key "[email protected]" -abs -o - Release > Release.gpg)
(cd ppa && gpg --default-key "[email protected]" --clearsign -o - Release > InRelease)
rm -f ppa/ppa.zip
(cd ppa && zip -r ppa.zip .)