1
0
mirror of https://gitlab.com/ykkzde/posy-cursors synced 2024-10-27 20:44:10 +00:00
archive-posy-cursors/.gitlab-ci.yml
2020-06-24 21:07:11 +03:00

50 lines
1.5 KiB
YAML

stages:
- package
Update-AUR:
image: archlinux/base
stage: package
only:
- /^v(\d+\.)*\d+$/
script:
- cd ./pkg/aur
- VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-)
# Update pkgver in PKBUILD
- echo "Updating PKGBUILDS with release information..."
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD
- echo "Installing Arch"
- pacman -Syu --noconfirm sudo base-devel openssh git openssl
# Build and update .SRCINFO
- cd posy-cursors/
- echo "makepkg"
- sudo -u nobody makepkg -c
- sudo -u nobody makepkg --printsrcinfo > .SRCINFO
- cd ..
# Configure SSH
- mkdir -p /root/.ssh
- cp ./aur.pub /root/.ssh/id_rsa.pub
- echo "${AUR_PRIVATE}" | base64 -d > /root/.ssh/id_rsa
- echo "Host aur.archlinux.org" >> /root/.ssh/config
- echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config
- echo " User aur" >> /root/.ssh/config
- chmod 600 /root/.ssh/{id_rsa*,config}
- eval `ssh-agent -s`
- echo -en "${SSH_PASSPHRASE}" | ssh-add /root/.ssh/id_rsa
- ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts
- git config --global user.name "Dmitry Porunov"
- git config --global user.email "dmitry@ykkz.de"
# Clone, commit and push
- git clone ssh://aur@aur.archlinux.org/posy-cursors.git aur-posy-cursors
- cd aur-posy-cursors
- cp ../posy-cursors/{PKGBUILD,.SRCINFO} ./
- git add PKGBUILD .SRCINFO
- git commit -m "Release v$VERSION"
- git push
- cd ..