Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zjeffer committed May 18, 2024
1 parent e3cc1a8 commit 2f43e6c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Build on latest git commit

on:
pull_request:
Expand All @@ -19,9 +19,8 @@ jobs:
image: duckonaut/hyprland-arch:latest
steps:
- name: Install dependencies
# TODO: remove hyprwayland-scanner-git once hyprland-git properly depends on it
run: |
sudo -u user sh -c "paru -Syu --noconfirm hyprwayland-scanner-git hyprland-git"
sudo -u user sh -c "paru -Syu --noconfirm hyprland-git"
- name: Checkout current repository
uses: actions/checkout@v4
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 2f43e6c

Please sign in to comment.