0

我对语义发布非常陌生,因此不确定我是否可以在单个 .releaserc 文件中一次执行多个@semantic-release/exec 。

请让我知道这是否可行,如果是,那么我的错误是什么。

我收到错误:

[7:30:34 AM] [semantic-release] › ℹ  Running semantic-release version 17.4.7
2021-09-03T07:30:34.784Z semantic-release:config load config from: /home/runner/work/docker-loki/docker-loki/.releaserc
2021-09-03T07:30:34.793Z semantic-release:config options values: {
  branches: [ 'main', { name: 'pre', prerelease: 'beta' } ],
  repositoryUrl: 'https://github.com/screencloud/docker-loki',
  tagFormat: 'v${version}',
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    '@semantic-release/github',
    [ [Array] ]
  ],
  _: [],
  debug: true,
  '$0': '/usr/local/bin/semantic-release'
}
[7:30:34 AM] [semantic-release] › ✖  EPLUGINSCONF The `plugins` configuration is invalid.
The plugins (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#plugins) option must be an array of plugin definions. A plugin definition is an npm module name, optionally wrapped in an array with an object.

The invalid configuration is [ [ '@semantic-release/exec', { prepareCmd1: './scripts/semantic-release/prepareCmd-loki.sh v${nextRelease.version}', publishCmd1: './scripts/semantic-release/publishCmd-loki.sh v${nextRelease.version}' }, '@semantic-release/exec', { prepareCmd2: './scripts/semantic-release/prepareCmd-grafana.sh v${nextRelease.version}', publishCmd2: './scripts/semantic-release/publishCmd-grafana.sh v${nextRelease.version}' } ] ].

AggregateError: 
    SemanticReleaseError: The `plugins` configuration is invalid.
        at module.exports (/usr/local/lib/node_modules/semantic-release/lib/get-error.js:6:10)
        at /usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:34:23
        at Array.reduce (<anonymous>)
        at module.exports (/usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:14:34)
        at module.exports (/usr/local/lib/node_modules/semantic-release/lib/get-config.js:84:35)
        at async module.exports (/usr/local/lib/node_modules/semantic-release/index.js:257:32)
        at async module.exports (/usr/local/lib/node_modules/semantic-release/cli.js:55:5)
    at module.exports (/usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:42:11)
    at module.exports (/usr/local/lib/node_modules/semantic-release/lib/get-config.js:84:35)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async module.exports (/usr/local/lib/node_modules/semantic-release/index.js:257:32)
    at async module.exports (/usr/local/lib/node_modules/semantic-release/cli.js:55:5)
Error: Process completed with exit code 1.

我的 .releaserc

{
  "branches": [
    "main",
    {
      "name": "pre",
      "prerelease": "beta"
    }
  ],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/github",
    [ [ '@semantic-release/exec', 
         { 
           prepareCmd: './scripts/semantic-release/prepareCmd-loki.sh v${nextRelease.version}',
           publishCmd: './scripts/semantic-release/publishCmd-loki.sh v${nextRelease.version}' 
          },
        '@semantic-release/exec', 
          { 
           prepareCmd1: './scripts/semantic-release/prepareCmd-grafana.sh v${nextRelease.version}',
           publishCmd1: './scripts/semantic-release/publishCmd-grafana.sh v${nextRelease.version}'
          } 
      ] 
    ]
  ],
}
4

0 回答 0