Skip to content

Build pinned commit corresponding to latest Hyprland release #3

Build pinned commit corresponding to latest Hyprland release

Build pinned commit corresponding to latest Hyprland release #3

Workflow file for this run

name: Build on latest release
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
# run every night at 2AM (the base docker image is updated at midnight)
- cron: '0 2 * * *'
jobs:
build:
runs-on: ubuntu-latest
container:
# image built from the Dockerfile in the .github/ folder
image: duckonaut/hyprland-arch:latest
steps:
- name: Install dependencies
run: |
pacman -Syu --noconfirm hyprland
- name: Get version from installed Hyprland
run: |
hash=$(awk -F'"' '/GIT_COMMIT_HASH/ { print $2 }' /usr/include/hyprland/src/version.h)
if [ -z "$hash" ]; then
echo "Failed to get GIT_COMMIT_HASH from /usr/include/hyprland/src/version.h"
exit 1
fi
echo "GIT_COMMIT_HASH=$hash" >> $GITHUB_ENV
- name: Checkout current repository and checkout pinned commit
uses: actions/checkout@v4
- name: Get pinned commit from hyprpm.toml file
run: |
hash=$GIT_COMMIT_HASH
if [ -z "$hash" ]; then
echo "Failed to get GIT_COMMIT_HASH from /usr/include/hyprland/src/version.h"
exit 1
fi
commit=$(awk -v hash="$hash" '/commit_pins/ { getline; while ($0 !~ /]/) { if ($0 ~ hash) { getline; print $2; exit } getline } }' hyprpm.toml)
if [ -z "$commit" ]; then
echo "Failed to get pinned commit from hyprpm.toml"
exit 1
fi
echo "PINNED_COMMIT=$commit" >> $GITHUB_ENV
- name: Checkout pinned commit
run: |
git checkout $PINNED_COMMIT
- name: Build current repository
run: |
meson setup build --wipe
ninja -C build