refactor: scripts to apps
This commit is contained in:
parent
24d3067e52
commit
ad9ac18c18
6
.github/workflows/update.yaml
vendored
6
.github/workflows/update.yaml
vendored
@ -29,12 +29,8 @@ jobs:
|
|||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Install NPM Packages
|
|
||||||
working-directory: ./client
|
|
||||||
run: npm i && npm ci # https://github.com/npm/cli/issues/7793
|
|
||||||
|
|
||||||
- name: Update
|
- name: Update
|
||||||
run: nix develop --command trevstack-update
|
run: nix run .#update
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
@ -7,13 +7,13 @@ next_version=$(echo "${version}" | awk -F. -v OFS=. '{$NF += 1 ; print}')
|
|||||||
|
|
||||||
echo "bumping client"
|
echo "bumping client"
|
||||||
cd "${git_root}/client"
|
cd "${git_root}/client"
|
||||||
npm version "${next_version}" && npm i
|
npm version "${next_version}"
|
||||||
git add package-lock.json
|
git add package-lock.json
|
||||||
git add package.json
|
git add package.json
|
||||||
|
|
||||||
echo "bumping nix"
|
echo "bumping nix"
|
||||||
cd "${git_root}"
|
cd "${git_root}"
|
||||||
nix-update --flake --version "${next_version}" --subpackage trevstack-client trevstack
|
nix-update --flake --version "${next_version}" --subpackage client default
|
||||||
git add flake.nix
|
git add flake.nix
|
||||||
|
|
||||||
git commit -m "bump: v${version} -> v${next_version}"
|
git commit -m "bump: v${version} -> v${next_version}"
|
||||||
|
@ -35,7 +35,7 @@ fi
|
|||||||
if [ "${updated}" = true ]; then
|
if [ "${updated}" = true ]; then
|
||||||
echo "updating nix hashes"
|
echo "updating nix hashes"
|
||||||
cd "${git_root}"
|
cd "${git_root}"
|
||||||
nix-update --flake --version=skip --subpackage trevstack-client trevstack
|
nix-update --flake --version=skip --subpackage client default
|
||||||
git add flake.nix
|
git add flake.nix
|
||||||
git commit -m "build(nix): updated nix hashes"
|
git commit -m "build(nix): updated nix hashes"
|
||||||
else
|
else
|
||||||
|
44
flake.nix
44
flake.nix
@ -79,8 +79,7 @@
|
|||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs;
|
packages = with pkgs; [
|
||||||
[
|
|
||||||
git
|
git
|
||||||
nix-update
|
nix-update
|
||||||
treli.packages."${system}".default
|
treli.packages."${system}".default
|
||||||
@ -106,16 +105,7 @@
|
|||||||
|
|
||||||
# Client
|
# Client
|
||||||
nodejs_22
|
nodejs_22
|
||||||
]
|
];
|
||||||
# Use .scripts
|
|
||||||
++ map (
|
|
||||||
x: (
|
|
||||||
pkgs.writeShellApplication {
|
|
||||||
name = "${pname}-${(lib.nameFromURL (baseNameOf x) ".")}";
|
|
||||||
text = builtins.readFile x;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
) (pkgs.lib.filesystem.listFilesRecursive ./.scripts);
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -173,6 +163,36 @@
|
|||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
apps = forSystem ({pkgs, ...}: {
|
||||||
|
update = {
|
||||||
|
type = "app";
|
||||||
|
program = pkgs.lib.getExe pkgs.writeShellApplication {
|
||||||
|
name = "update";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
git
|
||||||
|
nix
|
||||||
|
nodejs_22
|
||||||
|
go
|
||||||
|
nix-update
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./.scripts/update.sh;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
bump = {
|
||||||
|
type = "app";
|
||||||
|
program = pkgs.lib.getExe pkgs.writeShellApplication {
|
||||||
|
name = "bump";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
git
|
||||||
|
nodejs_22
|
||||||
|
nix-update
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./.scripts/bump.sh;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
formatter = forSystem ({pkgs, ...}: pkgs.alejandra);
|
formatter = forSystem ({pkgs, ...}: pkgs.alejandra);
|
||||||
|
|
||||||
packages = forSystem (
|
packages = forSystem (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user