Skip to content

Commit

Permalink
feat(repo): add beta/pre-release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jul 11, 2024
1 parent db0962a commit 390c4e2
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 21 deletions.
98 changes: 96 additions & 2 deletions .github/workflows/build-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ jobs:
steps:
- name: Container Setup
run: |
pacman -Sy --disable-download-timeout --needed --noconfirm \
archlinux-keyring
# Fix keys
rm -R /etc/pacman.d/gnupg/
gpg --refresh-keys
pacman-key --init
pacman-key --populate archlinux
pacman -Scc --noconfirm
pacman -Syu --disable-download-timeout --needed --noconfirm \
archlinux-keyring \
git \
jq \
reflector \
wget \
xorg-server-xvfb
Expand All @@ -44,6 +54,9 @@ jobs:
-O /usr/bin/build-pacman-repo
chmod +x /usr/bin/build-pacman-repo
# patch makepkg to allow running as root
build-pacman-repo patch-makepkg --replace
- name: Checkout
uses: actions/checkout@v4

Expand All @@ -52,9 +65,90 @@ jobs:
mkdir -p repo
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
- name: Download and Patch beta PKGBUILDs
working-directory: pkgbuilds
run: |
while IFS=' ' read -r repo og_pkg_name updated_pkg_name release_asset; do
# Skip lines that start with #
[[ $repo =~ ^#.*$ ]] && continue
echo "repo: ${repo}"
echo "og_pkg_name: ${og_pkg_name}"
echo "updated_pkg_name: ${updated_pkg_name}"
echo "release_asset: ${release_asset}"
latest_release=$(
curl -s "https://api.github.com/repos/${repo}/releases" | \
jq -r --arg release_asset "${release_asset}" '
map(select(.prerelease)) |
map(.assets[] | select(.name == $release_asset) | .browser_download_url) |
first
'
)
echo "latest_release: ${latest_release}"
if [[ -z "${latest_release}" ]]; then
echo "::warning:: No pre-release found for ${repo} with asset ${release_asset}"
continue
fi
mkdir -p ${updated_pkg_name}
pushd ${updated_pkg_name}
wget "${latest_release}" -O "${updated_pkg_name}.pkg.tar.gz"
# extract the package
tar -xvf "${updated_pkg_name}.pkg.tar.gz"
rm "${updated_pkg_name}.pkg.tar.gz"
# sed PKGBUILD
sed -i "s/pkgname='${og_pkg_name}'/pkgname='${updated_pkg_name}'/" PKGBUILD
sed -i "s/provides=(.*)/provides=('${og_pkg_name}')/" PKGBUILD
sed -i "s/conflicts=(.*)/conflicts=('${og_pkg_name}')/" PKGBUILD
# Check if provides is missing and append if necessary
if ! grep -q "^provides=" PKGBUILD; then
echo "provides=('${og_pkg_name}')" >> PKGBUILD
fi
# Check if conflicts is missing and append if necessary
if ! grep -q "^conflicts=" PKGBUILD; then
echo "conflicts=('${og_pkg_name}')" >> PKGBUILD
fi
echo "new PKGBUILD:"
cat PKGBUILD
# re-generate .SRCINFO
makepkg --printsrcinfo > .SRCINFO
# list files
echo "files in ${updated_pkg_name}:"
ls -a
popd
done < ../beta-repos.conf
- name: Build Pacman Repo
run: |
build-pacman-repo patch-makepkg --replace
# generate build-pacman-repo.yaml
build-pacman-repo print-config \
--repository repo/lizardbyte.db.tar.gz \
--container pkgbuilds \
--require-pkgbuild \
--require-srcinfo \
--with-record-failed-builds repo/failed-build-records.yaml \
--with-install-missing-dependencies true \
--with-clean-before-build false \
--with-clean-after-build false \
--with-force-rebuild true \
--with-pacman pacman \
--with-arch-filter x86_64 \
--with-check inherit \
--with-packager "${{ secrets.GH_BOT_NAME }} <${{ secrets.GH_BOT_EMAIL }}>" \
--with-allow-failure false \
--with-dereference-database-symlinks true \
> build-pacman-repo.yaml
build-pacman-repo build
- name: Create/Update GitHub Release
Expand Down
2 changes: 2 additions & 0 deletions beta-repos.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# repo_owner/repo_name og_pkg_name updated_pkg_name release_asset_file_name
lizardbyte/sunshine sunshine sunshine-git sunshine.pkg.tar.gz
19 changes: 0 additions & 19 deletions build-pacman-repo.yaml

This file was deleted.

0 comments on commit 390c4e2

Please sign in to comment.