Skip to content

Nightly Hyprland x86_64 Musl #34

Nightly Hyprland x86_64 Musl

Nightly Hyprland x86_64 Musl #34

name: "Nightly Hyprland x86_64 Musl"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
REPO_OWNER: "${{ github.repository_owner }}"
REPO_NAME: "${{ github.event.repository.name }}"
jobs:
build:
name: Build Nightly Packages
runs-on: ubuntu-latest
container:
image: ghcr.io/void-linux/void-buildroot-${{ matrix.config.libc }}:20240526R1
options: --platform ${{ matrix.config.platform }}
env:
PATH: "/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin"
ARCH: "${{ matrix.config.arch }}"
BOOTSTRAP: "${{ matrix.config.host }}"
TEST: "${{ matrix.config.test }}"
HOSTREPO: /hostrepo
strategy:
fail-fast: false
matrix:
config:
- {
arch: x86_64,
host: x86_64,
libc: musl,
platform: linux/amd64,
test: 1,
}
steps:
- name: Prepare container
run: |
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
ls -la
sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
xbps-install -Syu xbps
xbps-install -Syu
xbps-install -y tar curl
mkdir ~/void-pkgs
- name: Clone Void-Packages and prepare
run: |
cd ~/void-pkgs
git clone --depth 1 https://github.com/void-linux/void-packages.git
- name: Clone Hyprland-Void repo and prepare
run: |
cd ~/void-pkgs
git clone https://github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git
cd ${{ env.REPO_NAME }}
cat common/shlibs >> ../void-packages/common/shlibs
cp -r srcpkgs/* ../void-packages/srcpkgs
- name: Create hostrepo and prepare masterdir
run: |
cd ~/void-pkgs/void-packages
ln -s "$(pwd)" /hostrepo &&
common/travis/set_mirror.sh &&
common/travis/prepare.sh &&
common/travis/fetch-xtools.sh
- name: Get old packages and index
run: |
mkdir -v ~/oldpkgs
mkdir -v -p ~/hostdir/binpkgs
git clone https://github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git
cd ${{ env.REPO_NAME }}
git checkout repository-x86_64-musl
cp -v *.xbps ~/oldpkgs
cp -v *.xbps ~/hostdir/binpkgs
cd ~/hostdir/binpkgs
xbps-rindex -a *
echo "~/oldpkgs"
ls ~/oldpkgs
echo "~/hostdir/binpkgs"
ls ~/hostdir/binpkgs
# Try to avoid rebuilding packages which are already on the latest commit so we don't waste actions minutes
- name: Build hyprutils
run: |
export olddate=$(ls ~/oldpkgs | grep hyprutils-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hyprutils-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprutils.git
cd hyprutils
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprutils-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprutils-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprutils-nightly) &&
rm ~/oldpkgs/hyprutils-nightly* &&
cp ~/hostdir/binpkgs/hyprutils-nightly* ~/oldpkgs ||
echo "hyprutils-nightly is up to date"
- name: Build hyprlang
run: |
export olddate=$(ls ~/oldpkgs | grep hyprlang-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hyprlang-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprlang.git
cd hyprlang
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprlang-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprlang-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprlang-nightly) &&
rm ~/oldpkgs/hyprlang-nightly* &&
cp ~/hostdir/binpkgs/hyprlang-nightly* ~/oldpkgs ||
echo "hyprlang-nightly is up to date"
- name: Build hyprcursor
run: |
export olddate=$(ls ~/oldpkgs | grep hyprcursor-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hyprcursor-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprcursor.git
cd hyprcursor
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprcursor-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprcursor-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprcursor-nightly) &&
rm ~/oldpkgs/hyprcursor-nightly* &&
cp ~/hostdir/binpkgs/hyprcursor-nightly* ~/oldpkgs ||
echo "hyprcursor-nightly is up to date"
- name: Build hyprwayland-scanner
run: |
export olddate=$(ls ~/oldpkgs | grep hyprwayland-scanner-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hyprwayland-scanner-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprwayland-scanner.git
cd hyprwayland-scanner
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprwayland-scanner-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprwayland-scanner-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprwayland-scanner-nightly) &&
rm ~/oldpkgs/hyprwayland-scanner-nightly* &&
cp ~/hostdir/binpkgs/hyprwayland-scanner-nightly* ~/oldpkgs ||
echo "hyprwayland-scanner-nightly is up to date"
- name: Build hyprland
run: |
export olddate=$(ls ~/oldpkgs | grep -v devel | grep '^hyprland-nightly' | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep -v devel | grep '^hyprland-nightly' | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprland.git
cd hyprland
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprland-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprland-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprland-nightly) &&
rm ~/oldpkgs/hyprland-nightly* &&
cp ~/hostdir/binpkgs/hyprland-nightly* ~/oldpkgs ||
echo "hyprland-nightly is up to date"
- name: Build hyprland-protocols
run: |
export olddate=$(ls ~/oldpkgs | grep hyprland-protocols-nightly | cut -d. -f3)
export oldhash=$(ls ~/oldpkgs | grep hyprland-protocols-nightly | cut -d. -f4 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprland-protocols.git
cd hyprland-protocols
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprland-protocols-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprland-protocols-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprland-protocols-nightly) &&
rm ~/oldpkgs/hyprland-protocols-nightly* &&
cp ~/hostdir/binpkgs/hyprland-protocols-nightly* ~/oldpkgs ||
echo "hyprland-protocols-nightly is up to date"
- name: Build xdg-desktop-portal-hyprland
run: |
export olddate=$(ls ~/oldpkgs | grep xdg-desktop-portal-hyprland-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep xdg-desktop-portal-hyprland-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
cd xdg-desktop-portal-hyprland
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/xdg-desktop-portal-hyprland-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/xdg-desktop-portal-hyprland-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg xdg-desktop-portal-hyprland-nightly) &&
rm ~/oldpkgs/xdg-desktop-portal-hyprland-nightly* &&
cp ~/hostdir/binpkgs/xdg-desktop-portal-hyprland-nightly* ~/oldpkgs ||
echo "xdg-desktop-portal-hyprland-nightly is up to date"
- name: Build hypridle
run: |
export olddate=$(ls ~/oldpkgs | grep hypridle-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hypridle-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hypridle.git
cd hypridle
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hypridle-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hypridle-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hypridle-nightly) &&
rm ~/oldpkgs/hypridle-nightly* &&
cp ~/hostdir/binpkgs/hypridle-nightly* ~/oldpkgs ||
echo "hypridle-nightly is up to date"
- name: Build hyprlock
run: |
export olddate=$(ls ~/oldpkgs | grep hyprlock-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hyprlock-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprlock.git
cd hyprlock
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprlock-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprlock-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprlock-nightly) &&
~/oldpkgs/hyprlock-nightly* &&
cp ~/hostdir/binpkgs/hyprlock-nightly* ~/oldpkgs ||
echo "hyprlock-nightly is up to date"
- name: Build hyprpaper
run: |
export olddate=$(ls ~/oldpkgs | grep hyprpaper-nightly | cut -d. -f4)
export oldhash=$(ls ~/oldpkgs | grep hyprpaper-nightly | cut -d. -f5 | cut -d_ -f1)
echo "Previous Datestamp: $olddate"
echo "Previous Commit Shorthash: $oldhash"
git clone --filter=tree:0 https://github.com/hyprwm/hyprpaper.git
cd hyprpaper
export commitdate=$(date +'%Y%m%d' -d @$(git show -s --format=%ct))
export commithash=$(git show -s --format=%h)
echo "Current Datestamp: $commitdate"
echo "Current Commit Shorthash: $commithash"
sed -i "/^version/ s/$/.${commitdate}.${commithash}/" ~/void-pkgs/void-packages/srcpkgs/hyprpaper-nightly/template
cat ~/void-pkgs/void-packages/srcpkgs/hyprpaper-nightly/template | grep "version="
[ $commitdate -gt $olddate -o $commitdate -eq $olddate -a ! "$commithash" = "$oldhash" ] &&
(/hostrepo/xbps-src -j$(nproc) -s -H ~/hostdir pkg hyprpaper-nightly) &&
rm ~/oldpkgs/hyprpaper-nightly* &&
cp ~/hostdir/binpkgs/hyprpaper-nightly* ~/oldpkgs ||
echo "hyprpaper-nightly is up to date"
- name: Index refreshed packages
run: |
cd ~/oldpkgs
xbps-rindex -a *
# Retrieve the signing key from the separate private repository
- name: Retrieve private key
run: |
cd ~
curl -H 'Authorization: token ${{ secrets.PEM_PAT }}' \
-H 'Accept: application/vnd.github.v3.raw' \
-O -L https://api.github.com/repos/${{ env.REPO_OWNER }}/hyprland-void-private-pem/contents/private.pem
# We need to sign the packages with our private key so that they will be accepted by xbps remotely
# See: https://docs.voidlinux.org/xbps/repositories/signing.html
- name: Sign repository
run: |
export XBPS_PASSPHRASE=${{ secrets.PRIVATE_PEM_PASSPHRASE }}
xbps-rindex --privkey ~/private.pem --sign --signedby "${{ env.REPO_NAME }}-github-action" ~/oldpkgs
xbps-rindex --privkey ~/private.pem --sign-pkg ~/oldpkgs/*.xbps
# We'll blow the size of the repository up very quickly if we do not delete old iterations of the repository
- name: Delete old repository and recreate with new packages
run: |
cd ~/void-pkgs/${{ env.REPO_NAME }}
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git push https://${{ env.REPO_OWNER }}:${{ secrets.ACCESS_GIT }}@github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git -d repository-x86_64-musl
git switch --orphan repository-x86_64-musl
cp ~/oldpkgs/* ./
git add .
git commit -m "Upload latest packages to repository"
git push https://${{ env.REPO_OWNER }}:${{ secrets.ACCESS_GIT }}@github.com/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}.git repository-x86_64-musl