-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from l-Shane-l/github-actions
first pass at actions
- Loading branch information
Showing
6 changed files
with
247 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "CI" | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: cachix/install-nix-action@v25 | ||
- name: Build | ||
run: | | ||
nix develop --command bash -c "make -C tinywl -f Makefile.shared && cabal build" |
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,33 @@ | ||
name: "Release" | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: cachix/install-nix-action@v25 | ||
- name: Build | ||
run: | | ||
nix develop --command bash -c "make -C tinywl -f Makefile.shared && cabal build" | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Get binary path - adjust this based on your cabal output location | ||
BINARY_PATH=$(find dist-newstyle -type f -name "tiny-wlhs" -executable) | ||
# Create release notes from git tag message | ||
TAG_NAME=${GITHUB_REF#refs/tags/} | ||
RELEASE_NOTES=$(git tag -l --format='%(contents)' $TAG_NAME) | ||
# Create the release | ||
gh release create $TAG_NAME \ | ||
--title "Release $TAG_NAME" \ | ||
--notes "$RELEASE_NOTES" \ | ||
"$BINARY_PATH#tiny-wlhs" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,108 @@ | ||
{ | ||
description = "A Wayland compositor written in Haskell"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nix-github-actions.url = "github:nix-community/nix-github-actions"; | ||
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, nix-github-actions }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
|
||
haskellPackages = pkgs.haskellPackages.override { | ||
overrides = hself: hsuper: { | ||
wlhs-bindings = hself.callCabal2nix "wlhs-bindings" ./wlhs { }; | ||
tiny-wlhs = hself.callCabal2nix "tiny-wlhs" ./. { | ||
inherit (pkgs) libxkbcommon; | ||
}; | ||
}; | ||
}; | ||
in | ||
{ | ||
packages.default = haskellPackages.tiny-wlhs; | ||
|
||
githubActions = nix-github-actions.lib.mkGithubMatrix { | ||
checks = { | ||
x86_64-linux = { | ||
tiny-wlhs = self.packages.${system}.default; | ||
}; | ||
}; | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
wayland | ||
wayland-protocols | ||
wayland-scanner | ||
wlroots | ||
wlr-protocols | ||
pixman | ||
libxkbcommon | ||
libffi | ||
libdrm | ||
egl-wayland | ||
libGL | ||
mesa | ||
vulkan-loader | ||
pkg-config | ||
libudev-zero | ||
systemdLibs | ||
libdisplay-info | ||
libliftoff | ||
libinput | ||
xorg.libxcb | ||
xorg.libXau | ||
xorg.libXdmcp | ||
xorg.xcbutilrenderutil | ||
xorg.xcbutilwm | ||
xorg.xcbutilerrors | ||
|
||
# Development tools | ||
bear | ||
gdb | ||
haskell-language-server | ||
haskellPackages.fourmolu | ||
clang-tools | ||
|
||
# Example Wayland Clients | ||
yambar | ||
mako | ||
bemenu | ||
wbg | ||
|
||
# Build tools | ||
gcc | ||
gnumake | ||
libseat | ||
ghc | ||
cabal-install | ||
]; | ||
|
||
shellHook = '' | ||
export WAYLAND_PROTOCOLS=${pkgs.wayland-protocols}/share/wayland-protocols | ||
export WLR_PROTOCOLS=${pkgs.wlr-protocols}/share/wlr-protocols/ | ||
export WAYLAND_SCANNER=${pkgs.wayland-scanner}/bin/wayland-scanner | ||
export WLR_RENDERER=pixman | ||
export BEMENU_OPTS="-i -l 10 --fn 'monospace 12' --tb '#1d1f21' --tf '#c5c8c6' --fb '#1d1f21' --ff '#c5c8c6' --nb '#1d1f21' --nf '#c5c8c6' --hb '#1d1f21' --hf '#81a2be'" | ||
export BEMENU_BACKEND=wayland | ||
unset GHC_PACKAGE_PATH | ||
# Build tinywl | ||
echo "Building tinywl..." | ||
cd tinywl | ||
make -f Makefile.shared clean | ||
make -f Makefile.shared | ||
cd .. | ||
# Add the tinywl directory to LD_LIBRARY_PATH | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/tinywl | ||
''; | ||
}; | ||
} | ||
); | ||
} |
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