Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit ce817e3

Browse files
authored
Put .node-version and sync with nixpkgs (#496)
* Sync .node-version with nixpkgs * Put .node-version
1 parent 59cf978 commit ce817e3

File tree

7 files changed

+30
-6
lines changed

7 files changed

+30
-6
lines changed

.github/workflows/ci-elm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-node@v4
2727
with:
28-
node-version: '20.12.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","node --version | tr -d v"]}
28+
node-version-file: '.node-version'
2929
cache: npm
3030
- name: Install npm dependencies
3131
run: npm ci --ignore-scripts
@@ -40,7 +40,7 @@ jobs:
4040
- uses: actions/checkout@v4
4141
- uses: actions/setup-node@v4
4242
with:
43-
node-version: '20.12.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","node --version | tr -d v"]}
43+
node-version-file: '.node-version'
4444
cache: npm
4545
- name: Install npm dependencies
4646
run: npm ci --ignore-scripts

.github/workflows/ci-js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-node@v4
2727
with:
28-
node-version: '20.12.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","node --version | tr -d v"]}
28+
node-version-file: '.node-version'
2929
cache: npm
3030
- name: Install npm dependencies
3131
run: npm ci --ignore-scripts
@@ -47,7 +47,7 @@ jobs:
4747
- uses: actions/checkout@v4
4848
- uses: actions/setup-node@v4
4949
with:
50-
node-version: '20.12.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","node --version | tr -d v"]}
50+
node-version-file: '.node-version'
5151
cache: npm
5252
- name: Install npm dependencies
5353
run: npm ci --ignore-scripts

.github/workflows/firebase-hosting-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-node@v4
2727
with:
28-
node-version: '20.12.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","node --version | tr -d v"]}
28+
node-version-file: '.node-version'
2929
cache: npm
3030
- name: Install npm dependencies
3131
run: npm ci --ignore-scripts

.github/workflows/firebase-hosting-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424
- uses: actions/setup-node@v4
2525
with:
26-
node-version: '20.12.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","node --version | tr -d v"]}
26+
node-version-file: '.node-version'
2727
cache: npm
2828
- name: Install npm dependencies
2929
run: npm ci --ignore-scripts

.github/workflows/update-flake-lock-and-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
with:
1616
dry-run: ${{ github.event_name == 'pull_request' }}
1717
pr-title: 'Bump flake.lock and related dependencies'
18+
optional-run: |
19+
nix run .#bump-nix-dependencies
1820
secrets:
1921
APP_ID: ${{ secrets.DEPENDENCY_APP_ID }}
2022
APP_PRIVATE_KEY: ${{ secrets.DEPENDENCY_APP_PRIVATE_KEY }}

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.12.2

flake.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@
3030
typos
3131
];
3232
};
33+
34+
apps = {
35+
bump-nix-dependencies = {
36+
type = "app";
37+
program = with pkgs; lib.getExe (writeShellApplication {
38+
name = "bump-nix-dependencies.bash";
39+
runtimeInputs = [ nix git nodejs_20 sd ];
40+
# Why --really-refresh?: https://stackoverflow.com/q/34807971
41+
text = ''
42+
set -x
43+
44+
node --version | sd '^v?' "" > .node-version && git add .node-version
45+
git update-index -q --really-refresh
46+
git diff-index --quiet HEAD || git commit -m 'Sync .node-version with nixpkgs' .node-version
47+
'';
48+
meta = {
49+
description = "Bump dependency versions except managed by node package manager";
50+
};
51+
});
52+
};
53+
};
3354
}
3455
);
3556
}

0 commit comments

Comments
 (0)