-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (65 loc) · 3.28 KB
/
create-deb-ppa-packages.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Create deb ppa packages
# Creates deb artifacts of amd64 and arm64 architecture for selected platforms.
# Account at launchpad.net defines which platforms to target.
on: [workflow_dispatch,workflow_call]
permissions: write-all
jobs:
create-release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v1
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Install system packages
run: |
sudo apt update
sudo apt install -y devscripts apt-utils debhelper-compat
- name: Create deb packages
run: |
REPO_DIR=$PWD
TAG=$(git ls-remote --tags https://github.com/ton-blockchain/ton/ | tail -1 | sed -n -e 's/^.*tags\///p')
TAG=$(echo $TAG | sed s'/-/./')
DATE=$(date -R)
VERSION=${TAG:1}
echo "latest TAG = $TAG, VERSION=$VERSION, DATE=$DATE"
cd packages/deb
DEB_DIR=$PWD
curl -Ls https://github.com/ton-blockchain/ton/releases/latest/download/ton-linux-x86_64.zip -o ton-linux-amd64.zip
unzip -qq ton-linux-amd64.zip -d ton-linux-amd64
chmod -R 755 ton-linux-amd64
mkdir -p ton-linux-deb-amd64/{bin,lib/fift,share/ton}
cp -r ton-linux-amd64/smartcont ton-linux-deb-amd64/share/ton/
cp ton-linux-amd64/lib/* ton-linux-deb-amd64/lib/fift
rm -rf ton-linux-amd64/{lib,smartcont}
mv ton-linux-amd64/libtonlibjson.so* ton-linux-deb-amd64/lib/
[ -e ton-linux-amd64/libemulator.so ] && mv ton-linux-amd64/libemulator.so ton-linux-deb-amd64/lib/
cp ton-linux-amd64/* ton-linux-deb-amd64/bin/
chmod -R 755 ton-linux-deb-amd64/{bin,lib,share}/*
curl -Ls https://github.com/ton-blockchain/ton/releases/latest/download/ton-linux-arm64.zip -o ton-linux-arm64.zip
unzip -qq ton-linux-arm64.zip -d ton-linux-arm64
chmod -R 755 ton-linux-arm64
mkdir -p ton-linux-deb-arm64/{bin,lib/fift,share/ton}
cp -r ton-linux-arm64/smartcont ton-linux-deb-arm64/share/ton/
cp ton-linux-arm64/lib/* ton-linux-deb-arm64/lib/fift
rm -rf ton-linux-arm64/{lib,smartcont}
mv ton-linux-arm64/libtonlibjson.so* ton-linux-deb-arm64/lib/
[ -e ton-linux-arm64/libemulator.so ] && mv ton-linux-arm64/libemulator.so ton-linux-deb-arm64/lib/
cp ton-linux-arm64/* ton-linux-deb-arm64/bin/
chmod -R 755 ton-linux-deb-arm64/{bin,lib,share}/*
mkdir -p both/{amd64,arm64}
cp -R ton-linux-deb-amd64/* both/amd64/
cp -R ton-linux-deb-arm64/* both/arm64/
tar -czvf ton-${VERSION}.tar.gz -C both .
ln -s ton-${VERSION}.tar.gz ton_${VERSION}.orig.tar.gz
mkdir ton-$VERSION
cd ton-$VERSION
cp -R ../debian .
sed -i "s/REVISION/${VERSION}/g" debian/changelog
sed -i "s/VERSION/${VERSION}/g" debian/changelog
sed -i "s/DATE/${DATE}/g" debian/changelog
cat debian/{changelog,control}
debuild -sa -S -kDA58A5F65D5236A0C8FD9A54AF03339AD20F1920
dput ppa:ton-foundation/ppa ../ton_${VERSION}_source.changes