semantic-release / npm

:ship: semantic-release plugin to publish a npm package
MIT License
237 stars 112 forks source link

NPM plugin not respecting `pkgRoot` option #255

Closed harrysolovay closed 4 years ago

harrysolovay commented 4 years ago

Current behavior

I've configured my repository with pika, which builds the publish-ready assets, including a slimmed-down package.json, into a root-level pkg folder. I'm following the same protocol as octokit/core––wherein the NPM plugin is provided a pkgRoot option:

[
  "@semantic-release/npm",
  {
    "pkgRoot": "./pkg/"
  }
]

I've configured my workflow as follows:

name: Release
on:
  push:
    branches:
      - master
      - next
      - beta
      - "*.x"
jobs:
  release:
    name: release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: "12.x"
      - run: yarn install --frozen-lockfile
      - run: yarn test
      - run: yarn build
      - uses: actions/github-script@0.5.0
        with:
          script: |
            console.log(
              "DEBUG DEBUG DEBUG",
              require("fs").readFileSync(
                "./pkg/package.json",
                "utf8",
              ),
            );
      - run: yarn semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Expected behavior

As expected, the GitHub script action logs out the built contents of pkg/package.json (the build is successful). The GitHub release, notes, and change log generation are also successful. However, when it comes time to trigger the NPM publish, I get the following workflow error:

AggregateError: 
    SemanticReleaseError: Missing `package.json` file.
        at module.exports (/home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/@semantic-release/npm/lib/get-error.js:6:10)
        at module.exports (/home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/@semantic-release/npm/lib/get-pkg.js:17:33)
    at prepare (/home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/@semantic-release/npm/index.js:65:11) {
  name: 'AggregateError'
}error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Process completed with exit code 1.

Environment

Am I doing anything wrong? Thank you in advance for taking a look!

pvdlg commented 4 years ago

Can you please provide the full semantic-release logs?

harrysolovay commented 4 years ago
2020-02-23T22:45:36.1806089Z ##[section]Starting: Request a runner to run this job
2020-02-23T22:45:36.2351072Z Requesting a hosted runner in current repository's account/organization with labels: 'ubuntu-latest', require runner match: True
2020-02-23T22:45:36.2957513Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2020-02-23T22:45:36.3097215Z ##[section]Finishing: Request a runner to run this job
2020-02-23T22:45:43.0693455Z Current runner version: '2.165.2'
2020-02-23T22:45:43.0694466Z Prepare workflow directory
2020-02-23T22:45:43.0857398Z Prepare all required actions
2020-02-23T22:45:43.0865908Z Download action repository 'actions/checkout@v2'
2020-02-23T22:45:45.1330787Z Download action repository 'actions/setup-node@v1'
2020-02-23T22:45:45.2991611Z Download action repository 'actions/github-script@0.5.0'
2020-02-23T22:45:45.6342608Z ##[group]Run actions/checkout@v2
2020-02-23T22:45:45.6343241Z with:
2020-02-23T22:45:45.6343445Z   repository: harrysolovay/testing-semantic-release
2020-02-23T22:45:45.6343607Z   token: ***
2020-02-23T22:45:45.6343707Z   persist-credentials: true
2020-02-23T22:45:45.6343804Z   clean: true
2020-02-23T22:45:45.6343883Z   fetch-depth: 1
2020-02-23T22:45:45.6343976Z   lfs: false
2020-02-23T22:45:45.6344070Z ##[endgroup]
2020-02-23T22:45:47.1238968Z Added matchers: 'checkout-git'. Problem matchers scan action output for known warning or error strings and report these inline.
2020-02-23T22:45:47.1240185Z Syncing repository: harrysolovay/testing-semantic-release
2020-02-23T22:45:47.1251839Z Working directory is '/home/runner/work/testing-semantic-release/testing-semantic-release'
2020-02-23T22:45:47.1253107Z [command]/usr/bin/git version
2020-02-23T22:45:47.1253533Z git version 2.25.0
2020-02-23T22:45:47.1257931Z Deleting the contents of '/home/runner/work/testing-semantic-release/testing-semantic-release'
2020-02-23T22:45:47.1259420Z [command]/usr/bin/git init /home/runner/work/testing-semantic-release/testing-semantic-release
2020-02-23T22:45:47.1261617Z Initialized empty Git repository in /home/runner/work/testing-semantic-release/testing-semantic-release/.git/
2020-02-23T22:45:47.1262175Z [command]/usr/bin/git remote add origin https://github.com/harrysolovay/testing-semantic-release
2020-02-23T22:45:47.1262503Z [command]/usr/bin/git config --local gc.auto 0
2020-02-23T22:45:47.1262828Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-02-23T22:45:47.1263197Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2020-02-23T22:45:47.1264663Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +bb79a808f4fd21a8e071c9c10c835f5040bc24fa:refs/remotes/origin/master
2020-02-23T22:45:47.1264838Z remote: Enumerating objects: 24, done.        
2020-02-23T22:45:47.1264955Z remote: Counting objects:   4% (1/24)        
2020-02-23T22:45:47.1265063Z remote: Counting objects:   8% (2/24)        
2020-02-23T22:45:47.1265172Z remote: Counting objects:  12% (3/24)        
2020-02-23T22:45:47.1265265Z remote: Counting objects:  16% (4/24)        
2020-02-23T22:45:47.1265374Z remote: Counting objects:  20% (5/24)        
2020-02-23T22:45:47.1265482Z remote: Counting objects:  25% (6/24)        
2020-02-23T22:45:47.1265588Z remote: Counting objects:  29% (7/24)        
2020-02-23T22:45:47.1265696Z remote: Counting objects:  33% (8/24)        
2020-02-23T22:45:47.1265794Z remote: Counting objects:  37% (9/24)        
2020-02-23T22:45:47.1265905Z remote: Counting objects:  41% (10/24)        
2020-02-23T22:45:47.1266013Z remote: Counting objects:  45% (11/24)        
2020-02-23T22:45:47.1266117Z remote: Counting objects:  50% (12/24)        
2020-02-23T22:45:47.1266224Z remote: Counting objects:  54% (13/24)        
2020-02-23T22:45:47.1266318Z remote: Counting objects:  58% (14/24)        
2020-02-23T22:45:47.1266427Z remote: Counting objects:  62% (15/24)        
2020-02-23T22:45:47.1266536Z remote: Counting objects:  66% (16/24)        
2020-02-23T22:45:47.1266644Z remote: Counting objects:  70% (17/24)        
2020-02-23T22:45:47.1266751Z remote: Counting objects:  75% (18/24)        
2020-02-23T22:45:47.1266856Z remote: Counting objects:  79% (19/24)        
2020-02-23T22:45:47.1267110Z remote: Counting objects:  83% (20/24)        
2020-02-23T22:45:47.1267224Z remote: Counting objects:  87% (21/24)        
2020-02-23T22:45:47.1267331Z remote: Counting objects:  91% (22/24)        
2020-02-23T22:45:47.1267693Z remote: Counting objects:  95% (23/24)        
2020-02-23T22:45:47.1267799Z remote: Counting objects: 100% (24/24)        
2020-02-23T22:45:47.1267909Z remote: Counting objects: 100% (24/24), done.        
2020-02-23T22:45:47.1268004Z remote: Compressing objects:   5% (1/18)        
2020-02-23T22:45:47.1268195Z remote: Compressing objects:  11% (2/18)        
2020-02-23T22:45:47.1268385Z remote: Compressing objects:  16% (3/18)        
2020-02-23T22:45:47.1268498Z remote: Compressing objects:  22% (4/18)        
2020-02-23T22:45:47.1268604Z remote: Compressing objects:  27% (5/18)        
2020-02-23T22:45:47.1268711Z remote: Compressing objects:  33% (6/18)        
2020-02-23T22:45:47.1268801Z remote: Compressing objects:  38% (7/18)        
2020-02-23T22:45:47.1268908Z remote: Compressing objects:  44% (8/18)        
2020-02-23T22:45:47.1269019Z remote: Compressing objects:  50% (9/18)        
2020-02-23T22:45:47.1269126Z remote: Compressing objects:  55% (10/18)        
2020-02-23T22:45:47.1269247Z remote: Compressing objects:  61% (11/18)        
2020-02-23T22:45:47.1269336Z remote: Compressing objects:  66% (12/18)        
2020-02-23T22:45:47.1269446Z remote: Compressing objects:  72% (13/18)        
2020-02-23T22:45:47.1269557Z remote: Compressing objects:  77% (14/18)        
2020-02-23T22:45:47.1269671Z remote: Compressing objects:  83% (15/18)        
2020-02-23T22:45:47.1269778Z remote: Compressing objects:  88% (16/18)        
2020-02-23T22:45:47.1269884Z remote: Compressing objects:  94% (17/18)        
2020-02-23T22:45:47.1269972Z remote: Compressing objects: 100% (18/18)        
2020-02-23T22:45:47.1270243Z remote: Compressing objects: 100% (18/18), done.        
2020-02-23T22:45:47.1270648Z remote: Total 24 (delta 0), reused 19 (delta 0), pack-reused 0        
2020-02-23T22:45:47.1270962Z From https://github.com/harrysolovay/testing-semantic-release
2020-02-23T22:45:47.1271281Z  * [new ref]         bb79a808f4fd21a8e071c9c10c835f5040bc24fa -> origin/master
2020-02-23T22:45:47.1271586Z [command]/usr/bin/git checkout --progress --force -B master refs/remotes/origin/master
2020-02-23T22:45:47.1271840Z Reset branch 'master'
2020-02-23T22:45:47.1272119Z Branch 'master' set up to track remote branch 'master' from 'origin'.
2020-02-23T22:45:47.1272434Z [command]/usr/bin/git log -1
2020-02-23T22:45:47.1272564Z commit bb79a808f4fd21a8e071c9c10c835f5040bc24fa
2020-02-23T22:45:47.1272676Z Author: Harry Solovay <harrysolovay@gmail.com>
2020-02-23T22:45:47.1272931Z Date:   Sun Feb 23 14:45:11 2020 -0800
2020-02-23T22:45:47.1273016Z 
2020-02-23T22:45:47.1273325Z     Merge branch 'master' of https://github.com/harrysolovay/testing-semantic-release
2020-02-23T22:45:47.1274911Z Removed matchers: 'checkout-git'
2020-02-23T22:45:47.1425501Z ##[group]Run actions/setup-node@v1
2020-02-23T22:45:47.1425644Z with:
2020-02-23T22:45:47.1425727Z   node-version: 12.x
2020-02-23T22:45:47.1425980Z   always-auth: false
2020-02-23T22:45:47.1426245Z ##[endgroup]
2020-02-23T22:45:47.5606932Z [command]/bin/tar --version
2020-02-23T22:45:47.5664515Z tar (GNU tar) 1.29
2020-02-23T22:45:47.5675122Z Copyright (C) 2015 Free Software Foundation, Inc.
2020-02-23T22:45:47.5708750Z License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
2020-02-23T22:45:47.5709573Z This is free software: you are free to change and redistribute it.
2020-02-23T22:45:47.5710190Z There is NO WARRANTY, to the extent permitted by law.
2020-02-23T22:45:47.5710629Z 
2020-02-23T22:45:47.5711408Z Written by John Gilmore and Jay Fenlason.
2020-02-23T22:45:47.5736608Z [command]/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/23706722-2d4b-434a-a072-8341db35a7f3 -f /home/runner/work/_temp/46fe56f0-3308-4ad2-a450-9969f96f8bf5
2020-02-23T22:45:49.9335965Z Added matchers: 'tsc'. Problem matchers scan action output for known warning or error strings and report these inline.
2020-02-23T22:45:49.9352943Z Added matchers: 'eslint-stylish'. Problem matchers scan action output for known warning or error strings and report these inline.
2020-02-23T22:45:49.9358220Z Added matchers: 'eslint-compact'. Problem matchers scan action output for known warning or error strings and report these inline.
2020-02-23T22:45:49.9602490Z ##[group]Run yarn install --frozen-lockfile
2020-02-23T22:45:49.9602904Z yarn install --frozen-lockfile
2020-02-23T22:45:49.9641277Z shell: /bin/bash -e {0}
2020-02-23T22:45:49.9641389Z ##[endgroup]
2020-02-23T22:45:50.2742795Z yarn install v1.21.1
2020-02-23T22:45:50.3695839Z warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
2020-02-23T22:45:50.3734385Z [1/4] Resolving packages...
2020-02-23T22:45:51.0072133Z [2/4] Fetching packages...
2020-02-23T22:46:09.9062398Z warning np@5.2.1: The engine "git" appears to be invalid.
2020-02-23T22:46:09.9166638Z info fsevents@2.1.2: The platform "linux" is incompatible with this module.
2020-02-23T22:46:09.9168520Z info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
2020-02-23T22:46:09.9243894Z [3/4] Linking dependencies...
2020-02-23T22:46:20.2222075Z [4/4] Building fresh packages...
2020-02-23T22:46:20.8573086Z Done in 30.59s.
2020-02-23T22:46:20.9132272Z ##[group]Run yarn test
2020-02-23T22:46:20.9132491Z yarn test
2020-02-23T22:46:20.9180365Z shell: /bin/bash -e {0}
2020-02-23T22:46:20.9180470Z ##[endgroup]
2020-02-23T22:46:21.1141800Z yarn run v1.21.1
2020-02-23T22:46:21.1750622Z $ rm -rf pkg & jest --coverage
2020-02-23T22:46:24.2086324Z PASS src/index.spec.ts
2020-02-23T22:46:24.2237770Z ----------|---------|----------|---------|---------|-------------------
2020-02-23T22:46:24.2248810Z File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
2020-02-23T22:46:24.2250000Z ----------|---------|----------|---------|---------|-------------------
2020-02-23T22:46:24.2250696Z All files |     100 |      100 |     100 |     100 |                   
2020-02-23T22:46:24.2251281Z  index.ts |     100 |      100 |     100 |     100 |                   
2020-02-23T22:46:24.2252224Z ----------|---------|----------|---------|---------|-------------------
2020-02-23T22:46:24.2332655Z 
2020-02-23T22:46:24.2338296Z Test Suites: 1 passed, 1 total
2020-02-23T22:46:24.2338849Z Tests:       1 passed, 1 total
2020-02-23T22:46:24.2339241Z Snapshots:   0 total
2020-02-23T22:46:24.2339693Z Time:        2.435s
2020-02-23T22:46:24.2340053Z Ran all test suites.
2020-02-23T22:46:24.2573896Z Done in 3.14s.
2020-02-23T22:46:24.2776377Z ##[group]Run yarn build
2020-02-23T22:46:24.2776567Z yarn build
2020-02-23T22:46:24.2816174Z shell: /bin/bash -e {0}
2020-02-23T22:46:24.2816270Z ##[endgroup]
2020-02-23T22:46:24.4382158Z yarn run v1.21.1
2020-02-23T22:46:24.4935859Z $ pika build
2020-02-23T22:46:24.6697600Z @pika/pack v0.5.0
2020-02-23T22:46:25.2076557Z [1/5] Validating source...
2020-02-23T22:46:25.2080654Z [2/5] Preparing pipeline...
2020-02-23T22:46:25.2093594Z       ❇️  pkg/
2020-02-23T22:46:25.2237842Z [3/5] Running @pika/plugin-ts-standard-pkg...
2020-02-23T22:46:30.8474537Z       📝  pkg/dist-src/index.js [esnext]
2020-02-23T22:46:30.8478773Z       📝  pkg/dist-types/index.d.ts [types]
2020-02-23T22:46:30.8479379Z       » Linting with standard-pkg...
2020-02-23T22:46:30.8591461Z [4/5] Running @pika/plugin-build-node...
2020-02-23T22:46:30.9548892Z       📝  pkg/dist-node/index.js [main]
2020-02-23T22:46:30.9550862Z [5/5] Finalizing package...
2020-02-23T22:46:30.9556261Z       » copying LICENSE...
2020-02-23T22:46:30.9559408Z       » copying README.md...
2020-02-23T22:46:30.9568798Z       📝  pkg/package.json
2020-02-23T22:46:30.9569385Z       📦  pkg/
2020-02-23T22:46:30.9570806Z Done in 6.29s.
2020-02-23T22:46:30.9753442Z Done in 6.54s.
2020-02-23T22:46:30.9935800Z ##[group]Run actions/github-script@0.5.0
2020-02-23T22:46:30.9935926Z with:
2020-02-23T22:46:30.9936155Z   script: console.log(
  "DEBUG DEBUG DEBUG",
  require("fs").readFileSync(
    "./pkg/package.json",
    "utf8",
  ),
);

2020-02-23T22:46:30.9936312Z   github-token: ***
2020-02-23T22:46:30.9936399Z   debug: false
2020-02-23T22:46:30.9936481Z   user-agent: actions/github-script
2020-02-23T22:46:30.9936775Z   result-encoding: json
2020-02-23T22:46:30.9936865Z ##[endgroup]
2020-02-23T22:46:31.0865408Z DEBUG DEBUG DEBUG {
2020-02-23T22:46:31.0866494Z   "name": "testing-semantic-release",
2020-02-23T22:46:31.0866940Z   "description": "A living, comprehensive, best-practices template for Node packages",
2020-02-23T22:46:31.0867144Z   "version": "1.0.0",
2020-02-23T22:46:31.0867310Z   "license": "MIT",
2020-02-23T22:46:31.0867491Z   "files": [
2020-02-23T22:46:31.0867810Z     "dist-*/",
2020-02-23T22:46:31.0868320Z     "bin/"
2020-02-23T22:46:31.0868412Z   ],
2020-02-23T22:46:31.0868871Z   "pika": true,
2020-02-23T22:46:31.0868989Z   "sideEffects": false,
2020-02-23T22:46:31.0869796Z   "homepage": "https://github.com/harrysolovay/testing-semantic-release#readme",
2020-02-23T22:46:31.0870003Z   "bugs": {
2020-02-23T22:46:31.0870434Z     "url": "https://github.com/harrysolovay/testing-semantic-release/issues"
2020-02-23T22:46:31.0870607Z   },
2020-02-23T22:46:31.0870984Z   "repository": "github:harrysolovay/testing-semantic-release",
2020-02-23T22:46:31.0871106Z   "dependencies": {
2020-02-23T22:46:31.0871424Z     "typescript": "^3.7.5"
2020-02-23T22:46:31.0871606Z   },
2020-02-23T22:46:31.0871780Z   "devDependencies": {
2020-02-23T22:46:31.0872103Z     "@commitlint/cli": "^8.3.5",
2020-02-23T22:46:31.0872414Z     "@commitlint/config-conventional": "^8.3.4",
2020-02-23T22:46:31.0872580Z     "@pika/pack": "^0.5.0",
2020-02-23T22:46:31.0872911Z     "@pika/plugin-build-node": "^0.9.2",
2020-02-23T22:46:31.0873236Z     "@pika/plugin-ts-standard-pkg": "^0.9.2",
2020-02-23T22:46:31.0873569Z     "@semantic-release/changelog": "^5.0.0",
2020-02-23T22:46:31.0873843Z     "@semantic-release/git": "^9.0.0",
2020-02-23T22:46:31.0874014Z     "@types/jest": "^24.9.1",
2020-02-23T22:46:31.0874170Z     "@types/node": "^13.5.0",
2020-02-23T22:46:31.0874537Z     "@typescript-eslint/eslint-plugin": "^2.18.0",
2020-02-23T22:46:31.0874864Z     "@typescript-eslint/parser": "^2.18.0",
2020-02-23T22:46:31.0875033Z     "eslint": "^6.8.0",
2020-02-23T22:46:31.0875306Z     "eslint-config-prettier": "^6.9.0",
2020-02-23T22:46:31.0875618Z     "eslint-plugin-jest": "^23.6.0",
2020-02-23T22:46:31.0875933Z     "eslint-plugin-no-null": "^1.0.2",
2020-02-23T22:46:31.0876245Z     "eslint-plugin-prettier": "^3.1.2",
2020-02-23T22:46:31.0876561Z     "eslint-plugin-promise": "^4.2.1",
2020-02-23T22:46:31.0876828Z     "eslint-plugin-security": "^1.4.0",
2020-02-23T22:46:31.0877166Z     "eslint-plugin-sort-class-members": "^1.6.0",
2020-02-23T22:46:31.0877531Z     "eslint-plugin-sort-destructure-keys": "^1.3.3",
2020-02-23T22:46:31.0877877Z     "eslint-plugin-sort-keys-fix": "^1.1.0",
2020-02-23T22:46:31.0878204Z     "eslint-plugin-tsdoc": "^0.2.1",
2020-02-23T22:46:31.0878555Z     "eslint-plugin-typescript-sort-keys": "^0.5.0",
2020-02-23T22:46:31.0878831Z     "eslint-plugin-unicorn": "^15.0.1",
2020-02-23T22:46:31.0878986Z     "husky": "^4.2.1",
2020-02-23T22:46:31.0879138Z     "jest": "^25.1.0",
2020-02-23T22:46:31.0879286Z     "prettier": "^1.19.1",
2020-02-23T22:46:31.0879595Z     "semantic-release": "^17.0.4",
2020-02-23T22:46:31.0879845Z     "ts-jest": "^25.0.0",
2020-02-23T22:46:31.0880168Z     "ts-node": "^8.6.2"
2020-02-23T22:46:31.0880322Z   },
2020-02-23T22:46:31.0880466Z   "private": false,
2020-02-23T22:46:31.0880610Z   "publishConfig": {
2020-02-23T22:46:31.0880716Z     "access": "public"
2020-02-23T22:46:31.0880846Z   },
2020-02-23T22:46:31.0881150Z   "source": "dist-src/index.js",
2020-02-23T22:46:31.0881495Z   "types": "dist-types/index.d.ts",
2020-02-23T22:46:31.0881801Z   "main": "dist-node/index.js"
2020-02-23T22:46:31.0882172Z }
2020-02-23T22:46:31.0882343Z 
2020-02-23T22:46:31.1071698Z ##[group]Run yarn semantic-release
2020-02-23T22:46:31.1071949Z yarn semantic-release
2020-02-23T22:46:31.1107635Z shell: /bin/bash -e {0}
2020-02-23T22:46:31.1107713Z env:
2020-02-23T22:46:31.1107912Z   GITHUB_TOKEN: ***
2020-02-23T22:46:31.1108059Z   NPM_TOKEN: ***
2020-02-23T22:46:31.1108206Z ##[endgroup]
2020-02-23T22:46:31.2634640Z yarn run v1.21.1
2020-02-23T22:46:31.3270223Z $ /home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/.bin/semantic-release
2020-02-23T22:46:31.5740787Z [10:46:31 PM] [semantic-release] › ℹ  Running semantic-release version 17.0.4
2020-02-23T22:46:31.7920919Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
2020-02-23T22:46:31.7925119Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
2020-02-23T22:46:31.7927192Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
2020-02-23T22:46:31.7929619Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
2020-02-23T22:46:31.7931797Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
2020-02-23T22:46:31.7934692Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
2020-02-23T22:46:31.7936998Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
2020-02-23T22:46:31.7938685Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
2020-02-23T22:46:31.7940623Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
2020-02-23T22:46:31.7942654Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
2020-02-23T22:46:31.7944467Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
2020-02-23T22:46:31.7946338Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
2020-02-23T22:46:31.7947961Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
2020-02-23T22:46:31.7950383Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
2020-02-23T22:46:31.7952368Z [10:46:31 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
2020-02-23T22:46:32.8238372Z [10:46:32 PM] [semantic-release] › ✔  Run automated release from branch master on repository https://github.com/harrysolovay/testing-semantic-release.git
2020-02-23T22:46:33.0969916Z [10:46:33 PM] [semantic-release] › ✔  Allowed to push to the Git repository
2020-02-23T22:46:33.0973483Z [10:46:33 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
2020-02-23T22:46:33.0995336Z [10:46:33 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
2020-02-23T22:46:33.0995880Z [10:46:33 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
2020-02-23T22:46:33.1004982Z [10:46:33 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"
2020-02-23T22:46:33.1006068Z [10:46:33 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
2020-02-23T22:46:33.1020056Z [10:46:33 PM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication
2020-02-23T22:46:33.1086670Z [10:46:33 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
2020-02-23T22:46:33.1087164Z [10:46:33 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
2020-02-23T22:46:33.1271197Z [10:46:33 PM] [semantic-release] [@semantic-release/npm] › ℹ  Verify authentication for registry https://registry.npmjs.org/
2020-02-23T22:46:33.1313833Z [10:46:33 PM] [semantic-release] [@semantic-release/npm] › ℹ  Wrote NPM_TOKEN to /tmp/afcd5e1e52fdacce6c23f827d36706ef/.npmrc
2020-02-23T22:46:33.6693514Z harrysolovay
2020-02-23T22:46:33.6763386Z [10:46:33 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
2020-02-23T22:46:33.6834629Z [10:46:33 PM] [semantic-release] › ℹ  Found git tag v1.0.0 associated with version 1.0.0 on branch master
2020-02-23T22:46:33.6947318Z [10:46:33 PM] [semantic-release] › ℹ  Found 13 commits since last release
2020-02-23T22:46:33.6950875Z [10:46:33 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
2020-02-23T22:46:33.7480342Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge branch 'master' of https://github.com/harrysolovay/testing-semantic-release
2020-02-23T22:46:33.7507800Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-02-23T22:46:33.7516987Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: fix: still debugging
2020-02-23T22:46:33.7518300Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
2020-02-23T22:46:33.7519198Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(release): 1.1.0 [skip ci]
2020-02-23T22:46:33.7519504Z 
2020-02-23T22:46:33.7520273Z # [1.1.0](https://github.com/harrysolovay/testing-semantic-release/compare/v1.0.0...v1.1.0) (2020-02-23)
2020-02-23T22:46:33.7520505Z 
2020-02-23T22:46:33.7528257Z ### Bug Fixes
2020-02-23T22:46:33.7528510Z 
2020-02-23T22:46:33.7529647Z * added semantic-release changelog dep ([a535928](https://github.com/harrysolovay/testing-semantic-release/commit/a535928720cb60928044836265201c7ae332b18f))
2020-02-23T22:46:33.7532119Z * still debugging ([dd65607](https://github.com/harrysolovay/testing-semantic-release/commit/dd656076add5a387562ebf0aa55373d8b6b7b395))
2020-02-23T22:46:33.7532831Z * still debugging ([53223aa](https://github.com/harrysolovay/testing-semantic-release/commit/53223aab6619f5e72cb2b91e1c34e49fb1edb03e))
2020-02-23T22:46:33.7533918Z * still debugging ([1e40b9c](https://github.com/harrysolovay/testing-semantic-release/commit/1e40b9c6e6732adcc609ec5475259cc198847e3e))
2020-02-23T22:46:33.7535223Z * still debugging ([13786e3](https://github.com/harrysolovay/testing-semantic-release/commit/13786e39b5579a84e0a5967324683dc74b9d5570))
2020-02-23T22:46:33.7535454Z 
2020-02-23T22:46:33.7535651Z ### Features
2020-02-23T22:46:33.7542554Z 
2020-02-23T22:46:33.7543431Z * changelog generation ([e442023](https://github.com/harrysolovay/testing-semantic-release/commit/e442023c4472f9d7deb401d65012186ae5081a66))
2020-02-23T22:46:33.7544094Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-02-23T22:46:33.7545097Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: fix: still debugging
2020-02-23T22:46:33.7545752Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
2020-02-23T22:46:33.7546519Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge branch 'master' of https://github.com/harrysolovay/testing-semantic-release
2020-02-23T22:46:33.7547182Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-02-23T22:46:33.7547805Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: fix: still debugging
2020-02-23T22:46:33.7548715Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
2020-02-23T22:46:33.7549328Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(release): 1.1.0 [skip ci]
2020-02-23T22:46:33.7549501Z 
2020-02-23T22:46:33.7550327Z # [1.1.0](https://github.com/harrysolovay/testing-semantic-release/compare/v1.0.0...v1.1.0) (2020-02-23)
2020-02-23T22:46:33.7550656Z 
2020-02-23T22:46:33.7550854Z ### Bug Fixes
2020-02-23T22:46:33.7550970Z 
2020-02-23T22:46:33.7551662Z * added semantic-release changelog dep ([a535928](https://github.com/harrysolovay/testing-semantic-release/commit/a535928720cb60928044836265201c7ae332b18f))
2020-02-23T22:46:33.7552370Z * still debugging ([1e40b9c](https://github.com/harrysolovay/testing-semantic-release/commit/1e40b9c6e6732adcc609ec5475259cc198847e3e))
2020-02-23T22:46:33.7553021Z * still debugging ([13786e3](https://github.com/harrysolovay/testing-semantic-release/commit/13786e39b5579a84e0a5967324683dc74b9d5570))
2020-02-23T22:46:33.7553217Z 
2020-02-23T22:46:33.7553405Z ### Features
2020-02-23T22:46:33.7553534Z 
2020-02-23T22:46:33.7554155Z * changelog generation ([e442023](https://github.com/harrysolovay/testing-semantic-release/commit/e442023c4472f9d7deb401d65012186ae5081a66))
2020-02-23T22:46:33.7554757Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-02-23T22:46:33.7555518Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merge branch 'master' of https://github.com/harrysolovay/testing-semantic-release
2020-02-23T22:46:33.7556115Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-02-23T22:46:33.7556768Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: fix: still debugging
2020-02-23T22:46:33.7557418Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
2020-02-23T22:46:33.7558031Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore(release): 1.1.0 [skip ci]
2020-02-23T22:46:33.7558221Z 
2020-02-23T22:46:33.7558806Z # [1.1.0](https://github.com/harrysolovay/testing-semantic-release/compare/v1.0.0...v1.1.0) (2020-02-23)
2020-02-23T22:46:33.7559034Z 
2020-02-23T22:46:33.7559227Z ### Bug Fixes
2020-02-23T22:46:33.7559377Z 
2020-02-23T22:46:33.7560153Z * added semantic-release changelog dep ([a535928](https://github.com/harrysolovay/testing-semantic-release/commit/a535928720cb60928044836265201c7ae332b18f))
2020-02-23T22:46:33.7560843Z * still debugging ([13786e3](https://github.com/harrysolovay/testing-semantic-release/commit/13786e39b5579a84e0a5967324683dc74b9d5570))
2020-02-23T22:46:33.7561026Z 
2020-02-23T22:46:33.7561213Z ### Features
2020-02-23T22:46:33.7561385Z 
2020-02-23T22:46:33.7562074Z * changelog generation ([e442023](https://github.com/harrysolovay/testing-semantic-release/commit/e442023c4472f9d7deb401d65012186ae5081a66))
2020-02-23T22:46:33.7562689Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
2020-02-23T22:46:33.7571453Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: fix: still debugging
2020-02-23T22:46:33.7571948Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
2020-02-23T22:46:33.7572441Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: fix: added semantic-release changelog dep
2020-02-23T22:46:33.7572886Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
2020-02-23T22:46:33.7573340Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: changelog generation
2020-02-23T22:46:33.7573778Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is minor
2020-02-23T22:46:33.7574232Z [10:46:33 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 13 commits complete: minor release
2020-02-23T22:46:33.7574839Z [10:46:33 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
2020-02-23T22:46:33.7647294Z [10:46:33 PM] [semantic-release] › ℹ  The next release version is 1.1.0
2020-02-23T22:46:33.7654780Z [10:46:33 PM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
2020-02-23T22:46:33.8775834Z [10:46:33 PM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
2020-02-23T22:46:33.8790658Z [10:46:33 PM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/changelog"
2020-02-23T22:46:33.8803145Z [10:46:33 PM] [semantic-release] [@semantic-release/changelog] › ℹ  Update /home/runner/work/testing-semantic-release/testing-semantic-release/docs/CHANGELOG.md
2020-02-23T22:46:33.8807826Z [10:46:33 PM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/changelog"
2020-02-23T22:46:33.8911614Z [10:46:33 PM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/git"
2020-02-23T22:46:34.0080814Z [10:46:34 PM] [semantic-release] [@semantic-release/git] › ℹ  Found 1 file(s) to commit
2020-02-23T22:46:43.5871189Z [10:46:43 PM] [semantic-release] [@semantic-release/git] › ℹ  Prepared Git release: v1.1.0
2020-02-23T22:46:43.5872314Z [10:46:43 PM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/git"
2020-02-23T22:46:43.5940206Z [10:46:43 PM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
2020-02-23T22:46:43.6965461Z [10:46:43 PM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
2020-02-23T22:46:43.6968485Z [10:46:43 PM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/npm"
2020-02-23T22:46:43.6992223Z [10:46:43 PM] [semantic-release] › ✖  Failed step "prepare" of plugin "@semantic-release/npm"
2020-02-23T22:46:43.6999046Z [10:46:43 PM] [semantic-release] › ℹ  Start step "fail" of plugin "@semantic-release/github"
2020-02-23T22:46:44.8734645Z [10:46:44 PM] [semantic-release] [@semantic-release/github] › ℹ  Found existing semantic-release issue #1.
2020-02-23T22:46:46.3489570Z [10:46:46 PM] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #1: https://github.com/harrysolovay/testing-semantic-release/issues/1#issuecomment-590125636.
2020-02-23T22:46:46.3490531Z [10:46:46 PM] [semantic-release] › ✔  Completed step "fail" of plugin "@semantic-release/github"
2020-02-23T22:46:46.3492899Z [10:46:46 PM] [semantic-release] › ✖  ENOPKG Missing `package.json` file.
2020-02-23T22:46:46.3573004Z A package.json file (https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.
2020-02-23T22:46:46.3573334Z 
2020-02-23T22:46:46.3574586Z Please follow the npm guideline (https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid package.json file.
2020-02-23T22:46:46.3574712Z 
2020-02-23T22:46:46.3596314Z AggregateError: 
2020-02-23T22:46:46.3596656Z     SemanticReleaseError: Missing `package.json` file.
2020-02-23T22:46:46.3597339Z         at module.exports (/home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/@semantic-release/npm/lib/get-error.js:6:10)
2020-02-23T22:46:46.3597926Z         at module.exports (/home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/@semantic-release/npm/lib/get-pkg.js:17:33)
2020-02-23T22:46:46.3598459Z     at prepare (/home/runner/work/testing-semantic-release/testing-semantic-release/node_modules/@semantic-release/npm/index.js:65:11) {
2020-02-23T22:46:46.3598833Z   name: 'AggregateError'
2020-02-23T22:46:46.3774321Z }error Command failed with exit code 1.
2020-02-23T22:46:46.3775164Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2020-02-23T22:46:46.3829066Z ##[error]Process completed with exit code 1.
2020-02-23T22:46:46.3953364Z Post job cleanup.
2020-02-23T22:46:46.4900346Z [command]/usr/bin/git version
2020-02-23T22:46:46.4957633Z git version 2.25.0
2020-02-23T22:46:46.4984265Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-02-23T22:46:46.5014345Z http.https://github.com/.extraheader
2020-02-23T22:46:46.5029777Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2020-02-23T22:46:46.5155067Z Cleaning up orphan processes
pvdlg commented 4 years ago

In the verify step we check if there is a package.json and that check passes. In the prepare step we read the package.json again in case another plugin modified it. That second read fails.

We use the exact same code to read the package.json in the verify and prepare step.

I think something external to semantic-release delete the pkg directory or the pkg/package.json file while semantic-release is running. I can't figure out what though. Maybe you have multiple things happening in parallel, not sure how the GitHub actions behave.

Does this happens if you run semantic-release locally?

harrysolovay commented 4 years ago

@pvdlg the test script deletes pkg if present, but then the build script gets triggered and builds/rebuilds it. As for a local run, I'm getting Skip step "publish" of plugin "@semantic-release/npm" in dry-run mode... I'm assuming this is intentional behavior & will look over the docs right now... gonna see if I can get it to publish

harrysolovay commented 4 years ago

Something interesting happened: I made sure to trigger a build, so that the pkg folder would exist. It contained a package.json & all built assets. A local run with the --no-ci flag deleted it. Any ideas why this might be happening?

pvdlg commented 4 years ago

A local run with the --no-ci flag deleted it. Any ideas why this might be happening?

Not really. I don't think it's semantic-release that delete the folder. Maybe a commit hook that trigger your tests which delete the folder?

pvdlg commented 4 years ago

There: https://github.com/harrysolovay/testing-semantic-release/blob/1024ff5f8c40086f4eb5126d1f6118218b65d2b3/package.json#L80

harrysolovay commented 4 years ago

@pvdlg bingo!!! Apologies for this completely numb-headed (on my part) thread. Thank you so much!