diff --git a/dev/default.nix b/dev/default.nix index 86c1e69..9419880 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -2,6 +2,7 @@ imports = [ ./generate-schemas.nix ./formatting.nix + ./jobs/release.nix ]; perSystem = diff --git a/dev/jobs/release.nix b/dev/jobs/release.nix new file mode 100644 index 0000000..01397fd --- /dev/null +++ b/dev/jobs/release.nix @@ -0,0 +1,22 @@ +{ + config, + lib, + withSystem, + ... +}: + +{ + hercules-ci.github-releases = { + condition = { branch, ... }: branch == "master"; + releaseTag = + _: "v${withSystem config.defaultEffectSystem ({ config, ... }: config.packages.hyprspace.version)}"; + filesPerSystem = + { config, system, ... }: + [ + { + label = "hyprspace-${system}"; + path = lib.getExe config.packages.hyprspace; + } + ]; + }; +} diff --git a/flake.lock b/flake.lock index 8e407a2..aa385a1 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,30 @@ "type": "github" } }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751406060, + "narHash": "sha256-xlxgYZ0eCnr9ikQuM5VuD8rUjLdbGzSKgF2EoRKDn/8=", + "owner": "max-privatevoid", + "repo": "hercules-ci-effects", + "rev": "b8127446a483cfd91495037e343b592662033188", + "type": "github" + }, + "original": { + "owner": "max-privatevoid", + "ref": "pr/skip-if-exists", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1751011381, @@ -39,6 +63,7 @@ "root": { "inputs": { "flake-parts": "flake-parts", + "hercules-ci-effects": "hercules-ci-effects", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 32bb761..50505ae 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,13 @@ url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; + hercules-ci-effects = { + url = "github:max-privatevoid/hercules-ci-effects/pr/skip-if-exists"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-parts.follows = "flake-parts"; + }; + }; }; outputs = @@ -18,13 +25,13 @@ "aarch64-darwin" "x86_64-darwin" ]; + herculesCI.ciSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; flake = { config, ... }: { - herculesCI.ciSystems = [ - "x86_64-linux" - "aarch64-linux" - ]; nixosModules = { default = config.nixosModules.hyprspace; hyprspace = @@ -36,7 +43,10 @@ }; }; - imports = [ ./dev ]; + imports = [ + inputs.hercules-ci-effects.flakeModule + ./dev + ]; perSystem = { config, pkgs, ... }: