You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ykkzde_posy-cursors/.gitlab-ci.yml

59 lines
2.0 KiB

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-)
- echo "$CI_COMMIT_REF_NAME"
- echo "Pushing'v$VERSION'"
- sourceURL=https://gitlab.com/ykkzde/posy-cursors/-/archive/v$VERSION/cursorsPosy-v$VERSION.tar.gz?path=themes
- 'echo "Source: $sourceURL"'
- echo "Checking sha256sum checksums"
- 'sourceSHA=$(curl -sSL "$sourceURL" | sha256sum | cut -d" " -f1)'
# Update PKGBUILD version, source URL and sha256sum
- echo "Updating PKGBUILDS with release information..."
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i posy-cursors/PKGBUILD
- sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $sourceURL | sed 's/\//\\\//g')\")/" -i posy-cursors/PKGBUILD
- sed "s/^sha256sums=.*\$/sha256sums=('$sourceSHA')/" -i posy-cursors/PKGBUILD
- echo "Installing Arch"
- pacman -Syu --noconfirm sudo base-devel openssh git openssl
# Makepkg and .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 ..