Skip to content

Create deb ppa packages #21

Create deb ppa packages

Create deb ppa packages #21

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