Cozy 1.3.0 #52
Workflow file for this run
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: 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://[email protected]/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 "[email protected]" | |
git config --global user.name "Github Actions" | |
cd /tmp/aur | |
git commit -am "Bump version to $(cat /tmp/VERSION)" | |
git push |