-
-
Notifications
You must be signed in to change notification settings - Fork 127
Update AUR CI to build against PR instead of main #1962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f4d1f07
5332667
bdaa1fe
98c5385
c70d85e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,15 +13,20 @@ jobs: | |||||||||||||||||||||||||||||||||||
image: archlinux:latest | ||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||
- name: Install dependencies | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
pacman -Syu --noconfirm --needed capstone curl ffmpeg freetype2 glfw libuv sdl2 zlib git make pkg-config sudo base-devel pacman-contrib | ||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
set-safe-directory: true | ||||||||||||||||||||||||||||||||||||
- name: Create builduser | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
useradd builduser -m | ||||||||||||||||||||||||||||||||||||
passwd -d builduser | ||||||||||||||||||||||||||||||||||||
- name: Build AUR Package | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
git clone https://aur.archlinux.org/pcsx-redux-git.git | ||||||||||||||||||||||||||||||||||||
chown -R builduser:builduser pcsx-redux-git | ||||||||||||||||||||||||||||||||||||
cd pcsx-redux-git | ||||||||||||||||||||||||||||||||||||
mkdir /build | ||||||||||||||||||||||||||||||||||||
git clone https://aur.archlinux.org/pcsx-redux-git.git /build/pcsx-redux-git | ||||||||||||||||||||||||||||||||||||
chown -R builduser:builduser /build | ||||||||||||||||||||||||||||||||||||
cd /build/pcsx-redux-git | ||||||||||||||||||||||||||||||||||||
sed -i s,git+https://github.com/grumpycoders/pcsx-redux.git,git+file://$GITHUB_WORKSPACE#commit=$GITHUB_SHA,g PKGBUILD | ||||||||||||||||||||||||||||||||||||
sudo -u builduser makepkg | ||||||||||||||||||||||||||||||||||||
Comment on lines
+27
to
32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Harden AUR build: fix sed to replace entire URL+fragment; allow makepkg to install deps; ensure idempotent mkdir Apply: - mkdir /build
+ mkdir -p /build
git clone https://aur.archlinux.org/pcsx-redux-git.git /build/pcsx-redux-git
chown -R builduser:builduser /build
cd /build/pcsx-redux-git
- sed -i s,git+https://github.com/grumpycoders/pcsx-redux.git,git+file://$GITHUB_WORKSPACE#commit=$GITHUB_SHA,g PKGBUILD
- sudo -u builduser makepkg
+ # Allow makepkg to install missing (make)depends via pacman without prompting
+ printf 'builduser ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' >/etc/sudoers.d/99-builduser-pacman
+ chmod 0440 /etc/sudoers.d/99-builduser-pacman
+ # Replace entire upstream source (including any fragment) with local file:// commit
+ sed -E -i "s|git\+https://github.com/grumpycoders/pcsx-redux\.git(#.*)?|git+file://$GITHUB_WORKSPACE#commit=$GITHUB_SHA|g" PKGBUILD
+ # Build as unprivileged user and ensure deps are installed
+ sudo -u builduser makepkg -s --noconfirm --syncdeps --needed 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Upgrade checkout to v4 and pin the ref to the triggering commit (avoids Node16 deprecation and merge-commit surprises).
actionlint warns v3 won’t run anymore. Also, for PRs you probably want the head commit rather than the merge commit. Add
ref
andfetch-depth: 0
to guarantee the commit exists locally for yourfile://
source.Apply:
📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
18-18: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents