Skip to content

Update pdfjumbler

Update pdfjumbler #397

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
allPackages:
runs-on: ubuntu-latest
env:
cancelJob: false
srcModified: false
strategy:
fail-fast: false
matrix:
pkgInfo: ['zaread-git|N', 'holehe-git|Y', 'libxft-bgra|Y', 'onivim2-bin|Y', 'cst-git|N', 'cdwm-git|N',
'cslock-git|N', 'cdmenu-git|N', 'pvs-studio|N', 'knock-git|N', 'hakrawler-git|Y', 'bashmount|Y',
'bashmount-git|Y', 'firefox-sync|Y', 'pdd-git|Y', 'onivim2-nightly-bin|Y', 'python-isr-git|Y',
'repostat-git|Y', 'python-upnpclient|Y', 'imgur.sh|Y', 'vidmerger-bin|Y', 'vidmerger-git|Y',
'paisa-git|Y', 'paisa-bin|Y', 'pdfjumbler|Y']
steps:
- name: Set env variables
run: |
pkgName=$(echo "${{ matrix.pkgInfo }}" | cut -d$'|' -f1)
echo "pkgName=$pkgName" >> $GITHUB_ENV
inAur=$(echo "${{ matrix.pkgInfo }}" | cut -d$'|' -f2)
echo "inAur=$inAur" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 2
# - uses: actions/checkout@v2
# with:
# fetch-depth: 2
# repository: santilococo/calrepo
# token: ${{ secrets.GH_PAT }}
# path: calrepo
- name: Check modified files
run: |
git diff --name-only HEAD HEAD^ | grep -q "${{ env.pkgName }}" || echo "cancelJob=true" >> $GITHUB_ENV
msg="Update" && [ -f "${{ env.pkgName }}/.SRCINFO" ] || msg="Add"
echo "msg=$msg" >> $GITHUB_ENV
- name: Build package and output .SRCINFO
if: ${{ env.cancelJob == 'false' }}
uses: santilococo/calbuilder@master
with:
pkgDir: "${{ env.pkgName }}"
gpgPublicKey: "199980CE93F18E62"
gpgPrivateKey: "${{ secrets.GPG_PRIVATE_KEY }}"
gpgPassphrase: "${{ secrets.GPG_PASSPHRASE }}"
# - name: Push to calrepo
# if: ${{ env.cancelJob == 'false' && env.inAur == 'N' }}
# run: |
# pkgFileName=$(ls *.pkg.tar.zst)
# arch="$(grep -oP '(?<=arch=\(.).*?(?=.\))' "${{ env.pkgName }}/PKGBUILD")"
# findOutput=$(find -H "calrepo/$arch" -regex ".*${{ env.pkgName }}.*" | wc -l)
# [ $findOutput -eq 0 ] && msg="Add" || msg="Update"
# while read -r -d '' file; do
# rm -f "$file"
# done < <(find -H "calrepo/$arch" -regex ".*${{ env.pkgName }}.*" -print0)
# mv "$pkgFileName"* calrepo/$arch
# cd calrepo
# git config --local user.name "$(git log --format=%an | head -n 1)"
# git config --local user.email "$(git log --format=%ae | head -n 1)"
# gitStatus="$(git status --porcelain)"
# if [ ! -z "$gitStatus" ]; then
# git pull
# git add .
# git commit -m "$msg ${{ env.pkgName }}"
# git push
# fi
- name: Push .SRCINFO
if: ${{ env.cancelJob == 'false' }}
run: |
git config --local user.name "$(git log --format=%an | head -n 1)"
git config --local user.email "$(git log --format=%ae | head -n 1)"
mv .SRCINFO "${{ env.pkgName }}"
gitStatus="$(git status --porcelain)"
if [ ! -z "$gitStatus" ]; then
git pull
if echo "$gitStatus" | grep -q "PKGBUILD"; then
git add "${{ env.pkgName }}/PKGBUILD"
git commit -m "Bump ${{ env.pkgName }} version"
fi
if echo "$gitStatus" | grep -q ".SRCINFO"; then
git add "${{ env.pkgName }}/.SRCINFO"
git commit -m "${{ env.msg }} ${{ env.pkgName }}/.SRCINFO"
echo "srcModified=true" >> $GITHUB_ENV
fi
git push
fi
- name: Push to AUR
if: ${{ env.cancelJob == 'false' && env.inAur == 'Y' }}
run: |
[ ! -d $HOME/.ssh ] && mkdir -m 0700 $HOME/.ssh
ssh-keyscan -H aur.archlinux.org > $HOME/.ssh/known_hosts
echo "${{ secrets.AUR_SSH_KEY }}" > $HOME/.ssh/aur
chmod 0600 $HOME/.ssh/aur
ssh-keygen -vy -f $HOME/.ssh/aur -P ${{ secrets.AUR_SSH_PASSPHRASE }} > $HOME/.ssh/aur.pub
chmod 0644 $HOME/.ssh/aur.pub
# ls -al $HOME
# ls -al $HOME/.ssh
eval $(ssh-agent)
ssh-keygen -p -P "${{ secrets.AUR_SSH_PASSPHRASE }}" -N "" -f $HOME/.ssh/aur
ssh-add $HOME/.ssh/aur
git pull
msg="$(git log --format=%s | sed -n 2p)" && [ ${{ env.srcModified }} = true ] || msg="$(git log --format=%s | head -n 1)"
git config --local user.name "$(git log --format=%an | head -n 1)"
git config --local user.email "$(git log --format=%ae | head -n 1)"
git checkout --orphan ${{ env.pkgName }}
git rm -rf .
git remote add ${{ env.pkgName }} ssh://[email protected]/${{ env.pkgName }}.git
set +e; git pull ${{ env.pkgName }} master; set -e
git checkout master ${{ env.pkgName }}
find ${{ env.pkgName }} -mindepth 1 -maxdepth 1 -exec mv {} . \;
rm -rf *.zst* pkg src calrepo
if [ ! -z "$(git status --porcelain)" ]; then
git add .
git commit -m "$msg"
git push --set-upstream ${{ env.pkgName }} ${{ env.pkgName }}:master
fi