Build Nextcloud from upstream daily and push to AUR latest release #27
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: Build Nextcloud from upstream daily and push to AUR latest release | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: "15 4 * * *" # Every day at 04:15 UTC run update | |
# Update everyday consistently around 4:01 upstream | |
# https://download.nextcloud.com/desktop/daily/linux/ | |
jobs: | |
Update-AppImage: | |
runs-on: ubuntu-latest | |
environment: CI_PROD | |
container: archlinux:latest | |
steps: | |
- name: Checkout codebase | |
uses: actions/checkout@v4 | |
# TODO: Build automatically inside an ArchLinux Chroot | |
# Use ssh-agent for private key | |
- name: Pacman key init, upgrade, update to latest | |
run: pacman-key --init && pacman -Syu --noconfirm | |
- name: After update, restart gpg-server as it may be old | |
run : gpgconf --kill all | |
- name: Install all latest dependencies in container | |
run: | | |
pacman -S --noconfirm zlib curl p7zip wget bash base-devel git pacman-contrib openssh | |
- uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Create a user for makepkg usage | |
run: | | |
chmod a+rwx ./update.sh | |
chmod a+rwx -R . | |
useradd makepkg-user | |
- name: Git configuration | |
run: | | |
git config --global init.defaultBranch master | |
git config --global user.email "14914796+AkechiShiro@users.noreply.github.com" | |
git config --global user.name "Automatic GitHub CI" | |
- name: Git clone from AUR | |
run: GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new" git clone ssh://aur@aur.archlinux.org/nextcloud-client-appimage-daily.git | |
# INSERT step to setup git config from ENV variable containing secrets???? | |
# TODO: Find if that's a good solution ^ or to avoid in terms of security | |
# Read a lot of documentation and blogs... | |
# TODO: Forced to use chroot because we are the root user in the container | |
- name: Build latest update from upstream | |
run: | | |
chmod +x ./update.sh | |
su makepkg-user -c "bash ./update.sh" | |
# Move into AUR git repo | |
- name: Copy updated scripts to AUR repo and commit | |
run: | | |
cd nextcloud-client-appimage-daily | |
cp ../PKGBUILD ./ | |
cp ../.SRCINFO ./ | |
# Push to AUR the update | |
git status | |
git checkout master | |
git add -A PKGBUILD .SRCINFO | |
git commit -m "Update to latest version" | |
git status | |
git push -u origin master | |
#- name: Git Push | |
# run: git push origin master |