Skip to content

Commit 48e229f

Browse files
committed
build: generate .SRCINFO in build step
1 parent 80a77bc commit 48e229f

1 file changed

Lines changed: 24 additions & 27 deletions

File tree

.github/workflows/xivlauncher.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
run: |
4242
cd /home/builder/workspace
4343
sudo -u builder makepkg -scf --noconfirm
44+
sudo -u builder makepkg --printsrcinfo | tee .SRCINFO
4445
- name: Rename artifact
4546
run: |
4647
cd /home/builder/workspace
@@ -49,52 +50,48 @@ jobs:
4950
uses: actions/upload-artifact@v6
5051
with:
5152
name: xivlauncher
52-
path: /home/builder/workspace/*.pkg.tar.zst
53+
path: |
54+
/home/builder/workspace/*.pkg.tar.zst
55+
/home/builder/workspace/.SRCINFO
5356
if-no-files-found: error
5457
aur:
5558
needs: build
5659
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event.inputs.aur == 'true' }}
5760
runs-on: ubuntu-latest
58-
container: archlinux:latest
5961
steps:
60-
- name: Prepare container
61-
run: |
62-
echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
63-
pacman-key --init
64-
pacman -Sy --noconfirm --needed archlinux-keyring
65-
pacman -Syu --noconfirm base-devel git rsync openssh
66-
useradd -m -s /bin/bash builder
67-
echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder
6862
- name: Checkout repo
6963
uses: actions/checkout@v6
64+
with:
65+
path: 'github'
66+
- name: Prepare SSH
67+
run: |
68+
mkdir -p "$HOME"/.ssh
69+
chmod 700 "$HOME"/.ssh
70+
ssh-keyscan aur.archlinux.org >> "$HOME"/.ssh/known_hosts
71+
echo "${{ secrets.ssh_key }}" > "$HOME"/.ssh/id_ed25519
72+
ssh-keygen -y -f "$HOME"/.ssh/id_ed25519 > "$HOME"/.ssh/id_ed25519.pub
73+
chmod 400 "$HOME"/.ssh/*
7074
- name: Checkout AUR
7175
run: |
72-
cd /root
73-
mkdir -p .ssh
74-
chmod 700 .ssh
75-
ssh-keyscan aur.archlinux.org >> /root/.ssh/known_hosts
76-
echo "${{ secrets.ssh_key }}" > /root/.ssh/id_ed25519
77-
chmod 400 /root/.ssh/*
78-
ssh-keygen -y -f /root/.ssh/id_ed25519 > /root/.ssh/id_ed25519.pub
79-
cd /tmp
80-
git clone ssh://aur@aur.archlinux.org/xivlauncher.git aur
76+
git clone ssh://aur@aur.archlinux.org/xivlauncher.git "$GITHUB_WORKSPACE"/aur
8177
- name: Copy files
8278
run: |
83-
rsync -ahvP $GITHUB_WORKSPACE/{PKGBUILD,XIVLauncher.desktop,xivlauncher-core} /tmp/aur/
84-
- name: Generate .SRCINFO
79+
rsync -ahvP "$GITHUB_WORKSPACE"/{PKGBUILD,XIVLauncher.desktop,xivlauncher-core} "$GITHUB_WORKSPACE"/aur/
80+
- name: Download (.SRCINFO) artifact
81+
uses: actions/download-artifact@v8
82+
with:
83+
name: xivlauncher
84+
- name: Copy .SRCINFO
8585
run: |
86-
chown -R builder:builder /tmp/aur/
87-
cd /tmp/aur/
88-
sudo -u builder makepkg --printsrcinfo | tee .SRCINFO
89-
chown -R root:root /tmp/aur/
86+
rsync -ahvP "$GITHUB_WORKSPACE"/.SRCINFO "$GITHUB_WORKSPACE"/aur/.SRCINFO
9087
- name: Push
9188
run: |
92-
cd /tmp/aur/
89+
cd "$GITHUB_WORKSPACE"/aur
9390
git config user.email "cent@spline.de"
9491
git config user.name "cent"
9592
git add --all
9693
git commit -m 'sync from github'
9794
git push -u origin master
9895
- name: Cleanup SSH
9996
if: always()
100-
run: rm -rf /root/.ssh
97+
run: rm -rf "$HOME"/.ssh

0 commit comments

Comments
 (0)