Skip to content

Create AUR packages #10

Create AUR packages

Create AUR packages #10

name: Create AUR packages
on: [workflow_dispatch,workflow_call]
permissions: write-all
jobs:
create-release:
runs-on: ubuntu-22.04
env:
USER: runner
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
- uses: actions/checkout@v3
- name: SSH and git setup
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.AUR_REPO_KEY }}"
ssh-add -L
mkdir -p ~/.ssh
echo 'StrictHostKeyChecking accept-new' >> ~/.ssh/config
git config --global user.name ghactions
git config --global user.email [email protected]
- name: Push packages to official TON AUR repo (aur.archlinux.org)
run: |
TAG=$(git ls-remote --tags https://github.com/ton-blockchain/ton/ | tail -1 | sed -n -e 's/^.*tags\///p')
TAG=$(echo $TAG | sed s'/-/./')
echo "latest TAG = $TAG"
# ton-linux-x86-64.tar.gz comes from create-rpm workflow that commits this package to the current repo
curl -Ls https://github.com/ton-blockchain/packages/releases/latest/download/ton-linux-x86-64.tar.gz -o ton-linux-x86-64.tar.gz
tar -tvf ton-linux-x86-64.tar.gz
SHA256_AMD64=$(shasum -a 256 ton-linux-x86-64.tar.gz | cut -f 1 -d " ")
sed -i "/\\tpkgver = /c\\\tpkgver = ${TAG:1}" packages/arch/.SRCINFO
sed -i "/\\tsha256sums = /c\\\tsha256sums = ${SHA256_AMD64}" packages/arch/.SRCINFO
sed -i "/pkgver=/c\pkgver=${TAG:1}" packages/arch/PKGBUILD
sed -i -e "s/\(sha256sums=('\).*\(')\)/sha256sums=('${SHA256_AMD64}')/g" packages/arch/PKGBUILD
git clone ssh://[email protected]/ton-bin.git aur-ton
cd aur-ton
git rm -rf *
cp ../packages/arch/{PKGBUILD,.SRCINFO} .
git add .
git commit -m "create AUR TON release $TAG" || true
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}