-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
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: 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 } }' /usr/include/hyprland/hyprpm.toml) | ||
if [ -z "$commit" ]; then | ||
echo "Failed to get pinned commit from /usr/include/hyprland/hyprpm.toml" | ||
exit 1 | ||
fi | ||
echo "PINNED_COMMIT=$commit" >> $GITHUB_ENV | ||
- name: Checkout current repository and checkout pinned commit | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: $PINNED_COMMIT | ||
|
||
- name: Build current repository | ||
run: | | ||
meson setup build --wipe | ||
ninja -C build |