2022-08-13 05:33:15 -06:00
|
|
|
name: arch_package
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: archlinux
|
|
|
|
options: --privileged
|
|
|
|
volumes:
|
|
|
|
- /sys/fs/cgroup:/sys/fs/cgroup
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Prepare environment
|
|
|
|
run: |
|
|
|
|
pacman -Syu --needed --noconfirm base-devel git openssh
|
2022-08-13 09:42:58 -06:00
|
|
|
sed -i '/E_ROOT/d' /usr/bin/makepkg
|
2022-08-13 05:33:15 -06:00
|
|
|
|
|
|
|
- name: Import AUR key
|
|
|
|
run: |
|
|
|
|
mkdir ~/.ssh && chmod 700 ~/.ssh
|
|
|
|
echo '${{secrets.AUR_SSH_PRIVATE_KEY}}' >> ~/.ssh/id_rsa
|
|
|
|
chmod 600 ~/.ssh/id_rsa
|
|
|
|
ssh-keyscan -H aur.archlinux.org >> /etc/ssh/ssh_known_hosts
|
|
|
|
|
|
|
|
- name: Clone from AUR
|
|
|
|
run: |
|
|
|
|
export GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa'
|
|
|
|
git clone ssh://aur@aur.archlinux.org/hyfetch.git
|
|
|
|
|
|
|
|
- name: Upgrade PKGBUILD
|
|
|
|
run: |
|
|
|
|
cd hyfetch
|
|
|
|
sed -i "/^pkgver=/cpkgver=${{github.ref_name}}" PKGBUILD
|
|
|
|
sed -i "/^pkgrel=/cpkgrel=1" PKGBUILD
|
|
|
|
|
|
|
|
- name: Makepkg
|
|
|
|
run: |
|
|
|
|
cd hyfetch
|
2022-08-13 09:42:58 -06:00
|
|
|
yes | makepkg -si
|
2022-08-13 05:33:15 -06:00
|
|
|
|
|
|
|
- name: Test hyfetch
|
|
|
|
run: |
|
2022-08-13 09:42:58 -06:00
|
|
|
hyfetch --test-print
|
2022-08-13 05:33:15 -06:00
|
|
|
|
|
|
|
- name: Upload binaries to release
|
|
|
|
uses: shogo82148/actions-upload-release-asset@v1
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
|
|
asset_path: hyfetch/hyfetch*.pkg.tar.*
|
|
|
|
|
|
|
|
- name: set git info
|
|
|
|
run: |
|
2022-08-13 07:20:37 -06:00
|
|
|
git config --global user.name "Aleksana BOT"
|
2022-08-13 05:33:15 -06:00
|
|
|
git config --global user.email "me@aleksana.moe"
|
|
|
|
|
|
|
|
- name: Update PKGBUILD to AUR
|
|
|
|
run: |
|
|
|
|
cd hyfetch
|
2022-08-13 22:01:15 -06:00
|
|
|
rm -r .SRCINFO && makepkg --printsrcinfo >.SRCINFO
|
2022-08-13 05:33:15 -06:00
|
|
|
git stage . && git commit -m "BOT: upgrade to ${{github.ref_name}}"
|
|
|
|
export GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa'
|
|
|
|
git push
|
|
|
|
|
|
|
|
|