Skip to content

Commit

Permalink
Merge pull request #29 from l-Shane-l/github-actions
Browse files Browse the repository at this point in the history
first pass at actions
  • Loading branch information
l-Shane-l authored Feb 14, 2025
2 parents 2a4aa83 + 79f41c5 commit 5abf885
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
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"
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
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"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ A Wayland compositor written in Haskell, providing a configurable and programmab

The app can be configured in Config.hs

## PLEASE NOTE this project is still under development and is not yet ready for use as a daily driver.
## Status

[![CI](https://github.com/l-Shane-l/tiny-wlhs/actions/workflows/ci.yml/badge.svg)](https://github.com/l-Shane-l/tiny-wlhs/actions/workflows/ci.yml)

### PLEASE NOTE this project is still under development and is not yet ready for use as a daily driver.

## Features

Expand Down
82 changes: 82 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 108 additions & 0 deletions flake.nix
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
'';
};
}
);
}
3 changes: 3 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pkgs.mkShell {
bear
gdb
haskell-language-server
act
haskellPackages.fourmolu
clang-tools

#Example Wayland Clients
yambar
Expand Down

0 comments on commit 5abf885

Please sign in to comment.