Skip to content

Commit

Permalink
chore: postinstall for dependabot template-oss PR
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 12, 2022
1 parent 14e43f7 commit fc207a8
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ jobs:
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.')
if: startsWith(matrix.node-version, '10.') || startsWith(matrix.node-version, '12.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: ${{ !startsWith(matrix.node-version, '10.') }}
if: ${{ !startsWith(matrix.node-version, '10.') && !startsWith(matrix.node-version, '12.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
os: ubuntu-latest
shell: bash
node-version:
- 10.0.0
- 12.0.0
- 14.0.0
- 16.0.0
- 18.0.0
runs-on: ${{ matrix.platform.os }}
defaults:
run:
Expand Down Expand Up @@ -54,10 +59,10 @@ jobs:
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.')
if: startsWith(matrix.node-version, '10.') || startsWith(matrix.node-version, '12.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: ${{ !startsWith(matrix.node-version, '10.') }}
if: ${{ !startsWith(matrix.node-version, '10.') && !startsWith(matrix.node-version, '12.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
Expand Down Expand Up @@ -147,10 +152,10 @@ jobs:
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.')
if: startsWith(matrix.node-version, '10.') || startsWith(matrix.node-version, '12.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: ${{ !startsWith(matrix.node-version, '10.') }}
if: ${{ !startsWith(matrix.node-version, '10.') && !startsWith(matrix.node-version, '12.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ jobs:
RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run rp-pull-request --ignore-scripts -ws -iwr --if-present
npm exec --offline -- template-oss-release-manager
npm run rp-pull-request --ignore-scripts --if-present
- name: Commit
id: commit
env:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.4.4",
"version": "4.5.1",
"content": "scripts/template-oss",
"engines": ">=10",
"distPaths": [
Expand Down
31 changes: 31 additions & 0 deletions scripts/template-oss/_step-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: {{#if jobIsMatrix}}$\{{ matrix.node-version }}{{else}}{{ last ciVersions }}{{/if}}
{{#if lockfile}}
cache: npm
{{/if}}
{{#if updateNpm}}
{{#if jobIsMatrix}}
- name: Update Windows npm
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
cd package
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.') || startsWith(matrix.node-version, '12.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: $\{{ !startsWith(matrix.node-version, '10.') && !startsWith(matrix.node-version, '12.') }}
{{else}}
- name: Install npm@latest
{{/if}}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
{{/if}}

0 comments on commit fc207a8

Please sign in to comment.