Skip to content

Commit 9d96313

Browse files
authored
fix: revert publishing changes to fix release (#5364)
This reverts commit 65f77d9.
1 parent 6567e68 commit 9d96313

14 files changed

+45
-46
lines changed

.github/workflows/benchmark.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ jobs:
1515
- name: Use Node.js
1616
uses: actions/setup-node@v3
1717
with:
18-
node-version: lts/*
19-
cache: npm
18+
node-version: '*'
19+
cache: 'npm'
20+
cache-dependency-path: 'npm-shrinkwrap.json'
21+
check-latest: true
2022
- name: Install dependencies
2123
run: npm ci --no-audit && npm prune --production
2224
- name: Get size

.github/workflows/e2e-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ jobs:
3131
uses: actions/setup-node@v3
3232
with:
3333
node-version: ${{ matrix.node-version }}
34-
cache: npm
34+
cache: 'npm'
35+
cache-dependency-path: 'npm-shrinkwrap.json'
3536
check-latest: true
3637
- name: Cache verdaccio storage
3738
uses: actions/cache@v3
3839
with:
3940
path: ./.verdaccio-storage
40-
key: verdaccio-e2e-cli-${{ hashFiles('./package-lock.json') }}
41+
key: verdaccio-e2e-cli-${{ hashFiles('./npm-shrinkwrap.json') }}
4142
- name: Install dependencies
4243
run: npm ci --no-audit
4344
- name: Install pnpm

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
uses: actions/setup-node@v3
4848
with:
4949
node-version: ${{ matrix.node-version }}
50-
cache: npm
50+
cache: 'npm'
51+
cache-dependency-path: 'npm-shrinkwrap.json'
5152
check-latest: true
5253
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5354
- name: Setup Deno

.github/workflows/legacy-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ jobs:
4747
uses: actions/setup-node@v3
4848
with:
4949
node-version: ${{ matrix.node-version }}
50-
cache: npm
50+
cache: 'npm'
51+
cache-dependency-path: 'npm-shrinkwrap.json'
5152
check-latest: true
5253
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5354
- name: Setup Deno

.github/workflows/pre-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: lts/*
15-
cache: npm
14+
node-version: '*'
15+
cache: 'npm'
16+
check-latest: true
17+
cache-dependency-path: 'npm-shrinkwrap.json'
1618
registry-url: 'https://registry.npmjs.org'
1719
- name: Install core dependencies
1820
run: npm ci --no-audit

.github/workflows/release-please.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,41 @@ on:
44
branches:
55
- main
66
jobs:
7-
create-release:
7+
release-please:
88
runs-on: ubuntu-latest
9-
outputs:
10-
release_created: ${{ steps.release.outputs.release_created }}
119
steps:
1210
- uses: navikt/github-app-token-generator@a3831f44404199df32d8f39f7c0ad9bb8fa18b1c
1311
id: get-token
1412
with:
1513
private-key: ${{ secrets.TOKENS_PRIVATE_KEY }}
1614
app-id: ${{ secrets.TOKENS_APP_ID }}
17-
1815
- uses: GoogleCloudPlatform/release-please-action@v3
1916
id: release
2017
with:
2118
token: ${{ steps.get-token.outputs.token }}
2219
release-type: node
23-
package-name: netlify-cli
24-
25-
publish:
26-
runs-on: ubuntu-latest
27-
needs: create-release
28-
if: ${{ needs.create-release.outputs.release_created }}
29-
steps:
20+
package-name: 'netlify-cli'
3021
- uses: actions/checkout@v3
31-
22+
if: ${{ steps.release.outputs.release_created }}
3223
- uses: actions/setup-node@v3
3324
with:
34-
node-version: lts/*
35-
cache: npm
25+
node-version: '*'
26+
cache: 'npm'
27+
cache-dependency-path: 'npm-shrinkwrap.json'
28+
check-latest: true
3629
registry-url: 'https://registry.npmjs.org'
37-
38-
# when running npm publish dev dependencies won't be installed, but we need the is-ci binary to skip husky
39-
- name: Install is-ci globally
40-
run: npm install -g is-ci
41-
30+
if: ${{ steps.release.outputs.release_created }}
31+
# required for linting to pass
32+
- name: Install site dependencies
33+
run: npm run site:build:install
34+
if: ${{ steps.release.outputs.release_created }}
4235
- name: Install core dependencies
4336
run: npm ci --no-audit
44-
45-
# https://github.com/ossf/package-manager-best-practices/issues/35#issue-1360805761
46-
- name: Create shrinkwrap
47-
run: |
48-
npm prune --production
49-
rm -rf package-lock.json
50-
npm shrinkwrap
51-
37+
if: ${{ steps.release.outputs.release_created }}
5238
- run: npm publish
39+
if: ${{ steps.release.outputs.release_created }}
5340
env:
5441
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
42+
# required for tests to pass
43+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
44+
NETLIFY_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030
uses: actions/setup-node@v3
3131
with:
3232
node-version: ${{ matrix.node-version }}
33-
cache: npm
33+
cache: 'npm'
34+
cache-dependency-path: 'npm-shrinkwrap.json'
3435
check-latest: true
3536
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
3637
- name: Install core dependencies

.github/workflows/verify-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ jobs:
1616
- name: Use Node.js
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: lts/*
20-
cache: npm
19+
node-version: '*'
20+
cache: 'npm'
21+
cache-dependency-path: 'npm-shrinkwrap.json'
22+
check-latest: true
2123
- name: Install core dependencies
2224
run: npm ci --no-audit
2325
- name: Install site dependencies

.npmrc

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

package-lock.json renamed to npm-shrinkwrap.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"url": "https://github.com/netlify/cli/issues"
3939
},
4040
"scripts": {
41-
"prepare": "is-ci || husky install node_modules/@netlify/eslint-config-node/.husky/",
41+
"prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/",
4242
"start": "node ./bin/run.mjs",
4343
"test": "run-s format test:dev",
4444
"format": "run-s format:check-fix:*",
@@ -72,7 +72,7 @@
7272
},
7373
"config": {
7474
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,html}\" \"*.{mjs,cjs,js,md,html}\" \".*.{mjs,cjs,js,md,html}\"",
75-
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
75+
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!npm-shrinkwrap.json\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
7676
},
7777
"dependencies": {
7878
"@fastify/static": "^6.6.0",
@@ -193,7 +193,6 @@
193193
"graphviz": "^0.0.9",
194194
"husky": "^8.0.0",
195195
"ini": "^2.0.0",
196-
"is-ci": "^3.0.1",
197196
"mock-fs": "^5.1.2",
198197
"nock": "^13.2.4",
199198
"p-timeout": "^4.0.0",

tools/affected-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const getAffectedFiles = (changedFiles) => {
3333

3434
// in this case all files are affected
3535
if (
36-
changedFiles.includes('package-lock.json') ||
36+
changedFiles.includes('npm-shrinkwrap.json') ||
3737
changedFiles.includes('package.json') ||
3838
changedFiles.includes(join('.github', 'workflows', 'main.yml'))
3939
) {

tools/tests/affected-files.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ test.only('should get all files marked as affected when the package.json is touc
4444
t.deepEqual(affectedFiles, mockedTestFiles)
4545
})
4646

47-
test.serial('should get all files marked as affected when the package-lock.json is touched', async (t) => {
47+
test.serial('should get all files marked as affected when the npm-shrinkwrap.json is touched', async (t) => {
4848
const consoleStub = t.context.sandbox.stub(console, 'log').callsFake(() => {})
49-
const { affectedFiles, mockedTestFiles } = await getAffectedFilesFromMock(['package-lock.json'])
49+
const { affectedFiles, mockedTestFiles } = await getAffectedFilesFromMock(['npm-shrinkwrap.json'])
5050

5151
t.truthy(consoleStub.firstCall.calledWith('All files are affected based on the changeset'))
5252
t.deepEqual(affectedFiles, mockedTestFiles)

tools/tests/utils/file-systems.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'path'
22

33
const baseFiles = {
4-
'package-lock.json': '',
4+
'npm-shrinkwrap.json': '',
55
'README.md': '',
66
}
77

0 commit comments

Comments
 (0)