Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Commit 401b148

Browse files
committed
feat!: postinstall for dependabot template-oss PR
BREAKING CHANGE: `@npmcli/move-file` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0`
1 parent 059771b commit 401b148

14 files changed

+617
-132
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2
44

55
updates:
66
- package-ecosystem: npm
7-
directory: "/"
7+
directory: /
88
schedule:
99
interval: daily
1010
allow:

.github/matchers/tap.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
]
3030
}
3131
]
32-
}
32+
}

.github/workflows/audit.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,28 @@ on:
1010

1111
jobs:
1212
audit:
13+
name: Audit Dependencies
14+
if: github.repository_owner == 'npm'
1315
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash
1419
steps:
15-
- uses: actions/checkout@v3
16-
- name: Setup git user
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Setup Git User
1723
run: |
1824
git config --global user.email "[email protected]"
1925
git config --global user.name "npm CLI robot"
20-
- uses: actions/setup-node@v3
26+
- name: Setup Node
27+
uses: actions/setup-node@v3
2128
with:
22-
node-version: 16.x
23-
- name: Update npm to latest
29+
node-version: 18.x
30+
- name: Install npm@latest
2431
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
25-
- run: npm -v
26-
- run: npm i --ignore-scripts --no-audit --no-fund --package-lock
27-
- run: npm audit
32+
- name: npm Version
33+
run: npm -v
34+
- name: Install Dependencies
35+
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
36+
- name: Run Audit
37+
run: npm audit

.github/workflows/ci-release.yml

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: CI - Release
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
ref:
9+
required: true
10+
type: string
11+
check-sha:
12+
required: true
13+
type: string
14+
15+
jobs:
16+
lint-all:
17+
name: Lint All
18+
if: github.repository_owner == 'npm'
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- name: Create Check
25+
uses: LouisBrunner/[email protected]
26+
id: check
27+
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
status: in_progress
31+
name: Lint All
32+
sha: ${{ inputs.check-sha }}
33+
# XXX: this does not work when using the default GITHUB_TOKEN.
34+
# Instead we post the main job url to the PR as a comment which
35+
# will link to all the other checks. To work around this we would
36+
# need to create a GitHub that would create on-demand tokens.
37+
# https://github.com/LouisBrunner/checks-action/issues/18
38+
# details_url:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
ref: ${{ inputs.ref }}
43+
- name: Setup Git User
44+
run: |
45+
git config --global user.email "[email protected]"
46+
git config --global user.name "npm CLI robot"
47+
- name: Setup Node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 18.x
51+
- name: Install npm@latest
52+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
53+
- name: npm Version
54+
run: npm -v
55+
- name: Install Dependencies
56+
run: npm i --ignore-scripts --no-audit --no-fund
57+
- name: Lint
58+
run: npm run lint --ignore-scripts
59+
- name: Post Lint
60+
run: npm run postlint --ignore-scripts
61+
- name: Conclude Check
62+
uses: LouisBrunner/[email protected]
63+
if: always()
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
conclusion: ${{ job.status }}
67+
check_id: ${{ steps.check.outputs.check_id }}
68+
69+
test-all:
70+
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
71+
if: github.repository_owner == 'npm'
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
platform:
76+
- name: Linux
77+
os: ubuntu-latest
78+
shell: bash
79+
- name: macOS
80+
os: macos-latest
81+
shell: bash
82+
- name: Windows
83+
os: windows-latest
84+
shell: cmd
85+
node-version:
86+
- 14.17.0
87+
- 14.x
88+
- 16.13.0
89+
- 16.x
90+
- 18.0.0
91+
- 18.x
92+
runs-on: ${{ matrix.platform.os }}
93+
defaults:
94+
run:
95+
shell: ${{ matrix.platform.shell }}
96+
steps:
97+
- name: Create Check
98+
uses: LouisBrunner/[email protected]
99+
id: check
100+
101+
with:
102+
token: ${{ secrets.GITHUB_TOKEN }}
103+
status: in_progress
104+
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
105+
sha: ${{ inputs.check-sha }}
106+
# XXX: this does not work when using the default GITHUB_TOKEN.
107+
# Instead we post the main job url to the PR as a comment which
108+
# will link to all the other checks. To work around this we would
109+
# need to create a GitHub that would create on-demand tokens.
110+
# https://github.com/LouisBrunner/checks-action/issues/18
111+
# details_url:
112+
- name: Checkout
113+
uses: actions/checkout@v3
114+
with:
115+
ref: ${{ inputs.ref }}
116+
- name: Setup Git User
117+
run: |
118+
git config --global user.email "[email protected]"
119+
git config --global user.name "npm CLI robot"
120+
- name: Setup Node
121+
uses: actions/setup-node@v3
122+
with:
123+
node-version: ${{ matrix.node-version }}
124+
- name: Update Windows npm
125+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
126+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
127+
run: |
128+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
129+
tar xf npm-7.5.4.tgz
130+
cd package
131+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
132+
cd ..
133+
rmdir /s /q package
134+
- name: Install npm@7
135+
if: startsWith(matrix.node-version, '10.')
136+
run: npm i --prefer-online --no-fund --no-audit -g npm@7
137+
- name: Install npm@latest
138+
if: ${{ !startsWith(matrix.node-version, '10.') }}
139+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
140+
- name: npm Version
141+
run: npm -v
142+
- name: Install Dependencies
143+
run: npm i --ignore-scripts --no-audit --no-fund
144+
- name: Add Problem Matcher
145+
run: echo "::add-matcher::.github/matchers/tap.json"
146+
- name: Test
147+
run: npm test --ignore-scripts -ws -iwr --if-present
148+
- name: Conclude Check
149+
uses: LouisBrunner/[email protected]
150+
if: always()
151+
with:
152+
token: ${{ secrets.GITHUB_TOKEN }}
153+
conclusion: ${{ job.status }}
154+
check_id: ${{ steps.check.outputs.check_id }}

.github/workflows/ci.yml

+50-31
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ name: CI
55
on:
66
workflow_dispatch:
77
pull_request:
8-
branches:
9-
- '*'
108
push:
119
branches:
1210
- main
@@ -17,54 +15,73 @@ on:
1715

1816
jobs:
1917
lint:
18+
name: Lint
19+
if: github.repository_owner == 'npm'
2020
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
shell: bash
2124
steps:
22-
- uses: actions/checkout@v3
23-
- name: Setup git user
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
- name: Setup Git User
2428
run: |
2529
git config --global user.email "[email protected]"
2630
git config --global user.name "npm CLI robot"
27-
- uses: actions/setup-node@v3
31+
- name: Setup Node
32+
uses: actions/setup-node@v3
2833
with:
29-
node-version: 16.x
30-
- name: Update npm to latest
34+
node-version: 18.x
35+
- name: Install npm@latest
3136
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
32-
- run: npm -v
33-
- run: npm i --ignore-scripts --no-audit --no-fund
34-
- run: npm run lint
37+
- name: npm Version
38+
run: npm -v
39+
- name: Install Dependencies
40+
run: npm i --ignore-scripts --no-audit --no-fund
41+
- name: Lint
42+
run: npm run lint --ignore-scripts
43+
- name: Post Lint
44+
run: npm run postlint --ignore-scripts
3545

3646
test:
47+
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
48+
if: github.repository_owner == 'npm'
3749
strategy:
3850
fail-fast: false
3951
matrix:
40-
node-version:
41-
- 12.13.0
42-
- 12.x
43-
- 14.15.0
44-
- 14.x
45-
- 16.0.0
46-
- 16.x
4752
platform:
48-
- os: ubuntu-latest
53+
- name: Linux
54+
os: ubuntu-latest
4955
shell: bash
50-
- os: macos-latest
56+
- name: macOS
57+
os: macos-latest
5158
shell: bash
52-
- os: windows-latest
59+
- name: Windows
60+
os: windows-latest
5361
shell: cmd
62+
node-version:
63+
- 14.17.0
64+
- 14.x
65+
- 16.13.0
66+
- 16.x
67+
- 18.0.0
68+
- 18.x
5469
runs-on: ${{ matrix.platform.os }}
5570
defaults:
5671
run:
5772
shell: ${{ matrix.platform.shell }}
5873
steps:
59-
- uses: actions/checkout@v3
60-
- name: Setup git user
74+
- name: Checkout
75+
uses: actions/checkout@v3
76+
- name: Setup Git User
6177
run: |
6278
git config --global user.email "[email protected]"
6379
git config --global user.name "npm CLI robot"
64-
- uses: actions/setup-node@v3
80+
- name: Setup Node
81+
uses: actions/setup-node@v3
6582
with:
6683
node-version: ${{ matrix.node-version }}
67-
- name: Update to workable npm (windows)
84+
- name: Update Windows npm
6885
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
6986
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
7087
run: |
@@ -74,15 +91,17 @@ jobs:
7491
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
7592
cd ..
7693
rmdir /s /q package
77-
- name: Update npm to 7
78-
# If we do test on npm 10 it needs npm7
94+
- name: Install npm@7
7995
if: startsWith(matrix.node-version, '10.')
8096
run: npm i --prefer-online --no-fund --no-audit -g npm@7
81-
- name: Update npm to latest
97+
- name: Install npm@latest
8298
if: ${{ !startsWith(matrix.node-version, '10.') }}
8399
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
84-
- run: npm -v
85-
- name: add tap problem matcher
100+
- name: npm Version
101+
run: npm -v
102+
- name: Install Dependencies
103+
run: npm i --ignore-scripts --no-audit --no-fund
104+
- name: Add Problem Matcher
86105
run: echo "::add-matcher::.github/matchers/tap.json"
87-
- run: npm i --ignore-scripts --no-audit --no-fund
88-
- run: npm test --ignore-scripts
106+
- name: Test
107+
run: npm test --ignore-scripts -iwr

.github/workflows/codeql-analysis.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# This file is automatically added by @npmcli/template-oss. Do not edit.
22

3-
name: "CodeQL"
3+
name: CodeQL
44

55
on:
66
push:
77
branches:
88
- main
99
- latest
1010
pull_request:
11-
# The branches below must be a subset of the branches above
1211
branches:
1312
- main
1413
- latest
@@ -24,21 +23,16 @@ jobs:
2423
actions: read
2524
contents: read
2625
security-events: write
27-
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
language: [ javascript ]
32-
3326
steps:
34-
- uses: actions/checkout@v3
35-
- name: Setup git user
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Setup Git User
3630
run: |
3731
git config --global user.email "[email protected]"
3832
git config --global user.name "npm CLI robot"
3933
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v1
34+
uses: github/codeql-action/init@v2
4135
with:
42-
languages: ${{ matrix.language }}
36+
languages: javascript
4337
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v1
38+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)