Update repo's and AUR's PKGBUILD #107026
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update repo's and AUR's PKGBUILD | |
on: | |
push: | |
schedule: | |
- cron: '*/5 * * * *' | |
workflow_dispatch: | |
jobs: | |
update-repo: | |
runs-on: ubuntu-latest | |
container: archlinux:latest | |
steps: | |
- name: install dependencies | |
run: | | |
pacman -Syyu --noconfirm | |
pacman -S git binutils python python-pip --noconfirm | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: create user | |
run: | | |
useradd -m abohiccups | |
- name: update PKGBUILD | |
run: | | |
git clone https://github.com/jlambert360/FPM-AppImage /tmp/FPM-AppImage | |
cd /tmp/FPM-AppImage | |
PKGVER="$(git tag | tail -n1)" | |
TAGNAME="${PKGVER:1}" | |
git checkout --quiet "$(git rev-list -n 1 $PKGVER)" | |
APPIMAGE_SHA="$(curl -L https://github.com/jlambert360/FPM-AppImage/releases/download/$PKGVER/Faster_Project_Plus-x86-64.AppImage | sha256sum | sed 's/ -//')" | |
LAUNCHER_SHA="$(curl -L https://github.com/jlambert360/FPM-AppImage/releases/download/$PKGVER/Launcher.tar.gz | sha256sum | sed 's/ -//')" | |
SD_SHA="$(curl -L https://github.com/jlambert360/FPM-AppImage/releases/download/$PKGVER/sd.tar.gz | sha256sum | sed 's/ -//')" | |
cd - | |
sed -i "/pkgver=/c\pkgver=\'$PKGVER\'" ./PKGBUILD | |
sed -i "/_tagname=/c\_tagname=\'$TAGNAME\'" ./PKGBUILD | |
sed -i "/sha256sums=/c\sha256sums=(\'$APPIMAGE_SHA\' \'$LAUNCHER_SHA\' \'$SD_SHA\')" ./PKGBUILD | |
chown -R abohiccups:abohiccups . | |
su -c "makepkg --printsrcinfo > .SRCINFO" abohiccups | |
chown -R root:root . | |
- name: push changes to repo | |
run: | | |
git config --global user.name 'ABOhiccups' | |
git config --global user.email '[email protected]' | |
git add PKGBUILD .SRCINFO | |
if [[ `git status --porcelain` ]]; then | |
git commit -m "automatic: updated PKGBUILD (repo)" | |
git push | |
else | |
echo "Nothing to commit! (repo)" | |
fi | |
update-aur: | |
needs: update-repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
- name: Setup SSH Keys and known_hosts | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "${{ secrets.AUR_SSH_PRIVATE_KEY }}" | |
- name: push changes to aur | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
git clone ssh://[email protected]/project-plus-netplay.git /tmp/aur | |
cp {PKGBUILD,.SRCINFO} /tmp/aur/ | |
cd /tmp/aur | |
git config --global user.name 'ABOhiccups (github workflow https://github.com/ABOhiccups/project-plus-netplay-PKGBUILD)' | |
git config --global user.email '[email protected]' | |
git add PKGBUILD .SRCINFO | |
if [[ `git status --porcelain` ]]; then | |
git commit -m "automatic: updated PKGBUILD (AUR)" | |
git push | |
else | |
echo "Nothing to commit! (AUR)" | |
fi |