Skip to content

Commit

Permalink
CI: Simplify and merge PKGBUILD checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lah7 committed Apr 4, 2024
1 parent 68e9d79 commit a1f003d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ jobs:
path: 'gtk+*.tar.xz'
key: gtk-${{ env.GTK_VERSION }}

- name: Generate Checksum
run: |
cp PKGBUILD PKGBUILD.before
md5sum PKGBUILD >> PKGBUILD.md5
- name: Start Arch Linux
run: |
# Start and update Arch Linux within a Docker container
Expand All @@ -122,13 +117,21 @@ jobs:
docker exec archlinux /bin/bash -c "echo 'builder ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers"
docker exec archlinux chown -R builder /workspace
- name: Validate Package
- name: Validate PKGBUILD
run: |
# Validate the PKGBUILD is the same and free from errors
echo "This step will check whether the PKGBUILD needs updating"
# Keep a copy of the original
cp PKGBUILD PKGBUILD.before
md5sum PKGBUILD >> PKGBUILD.md5
# Validate the PKGBUILD - these commands modify the file
docker exec --workdir=/workspace --user builder archlinux makepkg --geninteg
docker exec --workdir=/workspace --user builder archlinux namcap -i PKGBUILD
- name: Build Arch Package
# Inform the user if changes need to be made
md5sum -c PKGBUILD.md5 || (echo -e "\nTo fix, please push a commit with the following changes to the PKGBUILD file.\nHere's the patch:\n" && diff -u PKGBUILD.before PKGBUILD)
- name: Make Package
run: |
docker exec --workdir=/workspace --user builder archlinux makepkg -s --noconfirm
Expand All @@ -137,13 +140,7 @@ jobs:
docker stop archlinux -t 1
docker rm archlinux
- name: Verify Checksum
run: |
echo "If this fails, the PKGBUILD needs updating"
diff PKGBUILD.before PKGBUILD
md5sum -c PKGBUILD.md5
- name: 'Upload Artifact: gtk3-classic'
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: gtk3-classic-run${{github.run_number}}-pkg
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ regenerated automatically:

(Provided in `pacman-contrib`)

For other distributions, it's just a SHA256 checksum of the files used in the package.
If you're not using Arch Linux, don't worry! When you create the pull request
and automated checks run, it'll fail ❌ and present a patch of required changes.


## Community
Expand Down

0 comments on commit a1f003d

Please sign in to comment.