1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
name: Deploy on AUR
on:
release:
types: [published]
#on:
# watch:
# types: [started]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libnode-dev node-gyp libssl-dev
sudo apt-get install npm
sudo npm install -g json
- name: Download latest cozy release
run: |
curl -s https://api.github.com/repos/geigi/cozy/releases/latest | json tag_name > /tmp/VERSION
echo https://github.com/geigi/cozy/archive/$(cat /tmp/VERSION).tar.gz > /tmp/RELEASE_URL
wget -O /tmp/cozy.tar.gz $(cat /tmp/RELEASE_URL)
sha256sum /tmp/cozy.tar.gz | cut -d " " -f 1 > /tmp/SHA256SUM
- 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_PRIVATE }}"
- name: Clone cozy-audiobooks repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: git clone ssh://aur@aur.archlinux.org/cozy-audiobooks.git /tmp/aur
- name: Update PKGBUILD
run: |
ls /tmp/aur
cd /tmp/aur
sed -i "s/^pkgver.*\$/pkgver=$(cat /tmp/VERSION)/" PKGBUILD
sed -i "s/^sha256sum.*\$/sha256sums=('$(cat /tmp/SHA256SUM)')/" PKGBUILD
sed -i "s/.*pkgver.*\$/ pkgver = $(cat /tmp/VERSION)/" .SRCINFO
sed -i "s/.*source.*\$/ source = https\:\/\/github.com\/geigi\/cozy\/archive\/$(cat /tmp/VERSION)\.tar\.gz/" .SRCINFO
sed -i "s/.*sha256sums.*\$/ sha256sums = $(cat /tmp/SHA256SUM)/" .SRCINFO
- name: Push changes
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
git config --global user.email "github@geigi.de"
git config --global user.name "Github Actions"
cd /tmp/aur
git commit -am "Bump version to $(cat /tmp/VERSION)"
git push
|