Giter Site home page Giter Site logo

exec's People

Contributors

axieum avatar dependabot[bot] avatar gr2m avatar greenkeeper[bot] avatar markmartirosian avatar meesvandongen avatar oscard0m avatar pvdlg avatar renovate[bot] avatar silthus avatar skovy avatar travi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

exec's Issues

Simple Script does nothing

I am trying to understand how/where the scripts run. I've got a very simple shell script for testing that I want to run during any step. I've tried several.

Below is my releaserc file as well as the contents of the script. I can see where the output of semantic release shows where it runs but there is never any output from the script. No output from the echo command or version.txt is ever created. Also, notice that I do not have "./" in front of my version.sh because this runs on a windows machine and errors out when it is included. Any tips are appreciated.

releaserc

{
"branches": ["master"],
"plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/changelog",
    ["@semantic-release/exec", {
      "publishCmd": "version.sh ${nextRelease.version}"
    }],
    ["@semantic-release/git", {
      "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
    }]
  
    ]
}

Shell script
#!/bin/bash

VERSION=$1
echo "This is the version from semantic release"
echo $VERSION >> version.txt

Add noReleaseCmd

It will be useful if there no release, then exec "noReleaseCmd".

You can do with "noReleaseCmd":

  1. notify developers if you want.

  2. throw error to stop semantic-release and CI flow

Is it possible?

Thanks for help!

stdout content ignored log message crashes azure devops build if using variables

In Azure DevOps certain variables can be set by echoing specific commands to the log.

For example, you can change the current build number to the release number from semantic-release by:
echo ##vso[build.updatebuildnumber]${nextRelease.version}

I am currently doing this inside of the @semantic-release/exec plugin. But as nothing is returned from the call this message gets logged:
The command echo ##vso[build.updatebuildnumber]${nextRelease.version} wrote invalid JSON to stdout. The stdout content will be ignored.

This, in turn, raises an error with azure pipelines because special characters are not allowed. (You can see it here)

I would propose to:

  1. either drop the message for commands returning nothing but a successful exit code. (Maybe just print it for debug purposes?)
  2. adding a switch to suppress this warning
  3. printing the already parsed command that is executed to the info message (The command echo ##vso[build.updatebuildnumber]1.2.3 wrote invalid JSON to stdout. The stdout content will be ignored. would not raise the error)

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.6 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.6

15.9.6 (2018-08-08)

Bug Fixes

  • do not convert ssh repositoryUrl to https (b895231)
Commits

The new version differs by 3 commits.

  • b895231 fix: do not convert ssh repositoryUrl to https
  • 8b8e40c docs(plugins): add semantic-release-firefox
  • 06695a1 chore(package): update xo to version 0.22.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of sinon is breaking the build 🚨

Version 5.0.10 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 5.0.9
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 9 commits.

  • 4313d2d Update docs/changelog.md and set new release id in docs/_config.yml
  • e21c92a Add release documentation for v5.0.10
  • 41d0dcb 5.0.10
  • 928379c Update History.md and AUTHORS for new release
  • 5ca48d3 Merge pull request #1802 from ifrost/feature/restore-default-sandbox-fake-timers
  • 087bc1c Cache reverse function
  • d19a4c0 Add issue number
  • 6799e1c Use fakeTimers in the default sandbox
  • 8b6f8a8 Revert spied fakeTimers to original state

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

exec lodash template compilation variables (with version mentioned)

Trying to access one of the variables shown in the example:

"publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"

in this project like so:

"success": [
      "@semantic-release/github",
      [
        "@semantic-release/exec",
        {
          "successCmd": "npm start -- --branch ${options.branch}"
        }
      ]
    ],

when this step run, I see this in the travis run:

[11:16:33 PM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/exec"
[11:16:33 PM] [semantic-release] [@semantic-release/exec] › ℹ  Call script npm start -- --branch 
> @kibibit/[email protected] start /home/travis/build/Kibibit/announce-it
> node ./bin/announce-it-cli.js "--branch"

which looks like the template variable wasn't injected there. I tried looking for a test in the exec.test.js file to look if this is tested (and see if the variable name is wrong in the docs) but couldn't find anything.

Is there a variable I can inject with the branch name? options.branch?

Thanks!

semantic-release: ^16.0.0-beta.22
@semantic-release/exec: ^3.4.0-beta.2

An in-range update of ava is breaking the build 🚨

The devDependency ava was updated from 1.2.1 to 1.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ava is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for 1.3.0

Bug fixes

  • We've fixed a rather embarrasing bug with t.throws() and t.throwsAsync(). If you'd set a code expectation to a number we never actually checked that the thrown error had such a code! Thanks to @qlonik for both spotting and fixing this. 82daa5e
  • 1.2.0 contained a regression which meant that if you faked clearTimeout(), you'd break AVA. That's now been fixed. 40f331c
  • Snapshot files are now recognized as source files, so if you're using watch mode and you delete one, AVA won't rerun all your test files. d066f6f

New features

You can now use require() in ava.config.js files to load non-ES modules. 334e15b

All changes

v1.2.1...v1.3.0

Thanks

Thank you @itaisteinherz, @jdalton, @kagawagao, @KompKK, @SleeplessByte, @Chrisyee22 and @qlonik for helping us with this release. We couldn't have done this without you!

Get involved

We welcome new contributors. AVA is a friendly place to get started in open source. We have a great article on getting started contributing and a comprehensive contributing guide.

Commits

The new version differs by 12 commits.

  • b0fadb4 1.3.0
  • 9600966 Bump dependencies
  • 82daa5e Assert on expected error code, even when a number
  • 1e3b072 Document timeout configuration
  • d97f11d Improve pronunciation examples
  • 40f331c Fix unbound reference to clearTimeout
  • 334e15b Support require() in config files
  • 5751226 Added few tests for lib/chalk.js
  • 7d10446 Fix link to Babel recipe
  • 565822e Update esm package detection
  • 2fce19f Remove the typings field in package.json
  • d066f6f Recognize snapshot files as source files

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/checkout v4.1.3@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
.github/workflows/test.yml
  • actions/checkout v4.1.3@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
  • actions/checkout v4.1.3@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
npm
package.json
  • @semantic-release/error ^3.0.0
  • aggregate-error ^3.0.0
  • debug ^4.0.0
  • execa ^5.0.0
  • lodash ^4.17.4
  • parse-json ^5.0.0
  • ava 5.1.0
  • nyc 15.1.0
  • semantic-release 21.1.2
  • sinon 17.0.1
  • stream-buffers 3.0.2
  • xo 0.39.1
  • semantic-release >=18.0.0
  • node >=14.17

  • Check this box to trigger a request for Renovate to run again on this repository

Make semantic-release sync Helm Chart.yaml version with package.json version

My application has a Helm chart that is used to deploy my app to Kubernetes whenever I do a release. It is located in a subdirectory called deploy in my root project directory.

app/
-- package.json
-- deploy/
---- Chart.yaml (want to sync this with package.json)

Is there a way to have semantic-release update the version field in that file (to be synced with the updated package.json version) as part of its process and also include it as part of the chore(release): x.x.x [skip ci] commit changeset that it generates?

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>semantic-release/.github)

Execute script by commit

Hello,
I need to update the change log of each commit with information from another source, for that i need to execute a script for each commit.
It's possible to execute the script with each commit?
If it's possible, then increment the change log information from each commits with information from another source its possible?

Run plugin using CLI

Is it possible to configure this plugin via the command line and not a config file?

Allow to set the shell

I would like to use semantic-release to publish a PowerShell module. For that, I would like to write the cmd in PowerShell and execute it with pwsh, through the shell option that can be passed to execa / child_process. Currently I need to manually call pwsh -c '...', which makes quoting difficult.

replace travis with actions

Part of semantic-release/semantic-release#1692

Todos

  • delete .travis.yml
  • create .github/workflows/{test,release}.yml (copy from https://github.com/semantic-release/npm/tree/master/.github/workflows)
  • remove package-lock.json from .gitignore
  • delete .npmrc and .yarnrc
  • README
    • remove travis/codecov badges
    • add actions badge instead (replace REPO NAME HERE ;): [![Build Status](https://github.com/semantic-release/[REPO NAME HERE]/workflows/Test/badge.svg)](https://github.com/semantic-release/[REPO NAME HERE]/actions?query=workflow%3ATest+branch%3Amaster)
  • create package-json.lock
  • add to package.json:
    • test:ci script which doesn't run lint pre script

    • renovate config

         "renovate": {
           "extends": [
             "github>semantic-release/.github"
           ]
         }
      
  • update branch protection: remove required status by Travis and Codecov, add required status for "test" (wait for first build of PR)

default error output formatting isn't ergonomic

I know I can provide a failCmd, and I'll do that, but it seems to me the default failure output could be improved. It prints the stdout stringified, which is an assault on the eyes...

Aside from that it's not 100% straightforward how to deal with quoting in making a failCmd that will print the output as-is.

  shortMessage: 'Command failed with exit code 1: ./run release 7.0.0',
  command: './run release 7.0.0',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout:
   'Login Succeeded\nmaster\njcore/clarity\n*********************************************\nSuccessfully compiled 414 files with Babel.\nSuccessfully compiled 714 files with Babel.\nHappy[1]: Version: 5.0.1. Threads: 4\nHappy[1]: All set; signaling webpack to proceed.\nHash: \u001b[1m8a4bddc52b72ec4bb568\u001b[39m\u001b[22m\nVersion: webpack \u001b[1m4.28.0\u001b[39m\u001b[22m\nTime: \u001b[1m64663\u001b[39m\u001b[22mms\nBuilt at: 09/30/2020 \u001b[1m10:20:58 PM\u001b[39m\u001b[22m\n                               \u001b[1mAsset\u001b[39m\u001b[22m       \u001b[1mSize\u001b[39m\u001b[22m  \u001b[1mChunks\u001b[39m\u001b[22m  \u001b[1m\u001b[39m\u001b[22m           \u001b[1m\u001b[39m\u001b[22m       \u001b[1mChunk Names\u001b[39m\u001b[22m\n           \u001b[1m\u001b[32m0_e0568fa039ca1be3a035.js\u001b[39m\u001b[22m   46.9 KiB       \u001b[1m0\u001b[39m\u001b[22m  \u001b[1m\u001b[32m[emitted]\u001b[39m\u001b[22m         \n       \u001b[1m\u001b[32m0_e0568fa039ca1be3a035.js.map\u001b[39m\u001b[22m    123 KiB       \u001b[1m0\u001b[39m\u001b[22m  \u001b[1m\u001b[32m[emitted]\u001b[39m\u001b[22m         \n          \u001b[1m\u001b[32m11_5b4b19d4d23cb7309e43.js\u001b[39m\u001b[22m   71.6 KiB      \u001b[1m11\u001b[39m\u001b[22m  \u001b[1m\u001b[32m[emitted]\u001b[39m\u001b[22m         \n      \u001b[1m\u001b[32m11_5b4b19d4d23cb7309e43.js.map\u001b[39m\u001b[22m    300 KiB      \u001b[1m11\u001b[39m\u001b[22m  \u001b[1m\u001b[32m[emitted]\u001b[39m\u001b[22m         \n          \u001b[1m\u001b[32m12_1530a720f145ffeffdf4.js\u001b[39m\u001b[22m   26.1 KiB      \u001b[1m12\u001b[39m\u001b[22m  \u001b[1m\u001b[32m[emitted]\u001b[39m\u001b[22m         \n      \u001b[1m\u001b[32m12_1530a720f145ffeffdf4.js.map\u001b[39m\u001b[22m   56.2 KiB      \u001b[1m12\u001b[39m\u001b[22m  \u001

How to use it to prepare server/package.json as well?

Hi and thanks for helping,

I would like to update the version number as well in server/package.json while publishing with semantic-release

How can I do using @semantic-release/exec, it seems that only the publish step is having the version while I need to prepare it first and commit it with @semantic-release/git.

Why exec prepare task does not expose the releaseVersion?

I am struggling to get semantic-release working within my gradle project.

I used to use gradle-release-plugin, but to keep it, I need to have the ${nextRelease.version} during the prepare step.

I was able to run it during the release step, but then I do not get the change included by the plugin in the release. The plugin will:

  • The plugin checks for any un-committed files (Added, modified, removed, or un-versioned).
  • Checks for any incoming or outgoing changes.
  • Checkout to the release branch and merge from the working branch (optional, for GIT only, with pushReleaseVersionBranch)
  • Removes the SNAPSHOT flag on your project's version (If used)
  • Prompts you for the release version.
  • Checks if your project is using any SNAPSHOT dependencies
  • Will build your project.
  • Commits the project if SNAPSHOT was being used.
  • Creates a release tag with the current version.
  • Checkout to the working branch (optional, for GIT only, with pushReleaseVersionBranch)
  • Prompts you for the next version.
  • Commits the project with the new version.

It's not the first time I ask this myself so I ask you now:

Why from @semantic-release/exec prepare step we can't have the releaseVersion available when a plugin can have it during the prepare step?

Doesn't work with semantic-release beta

Problem

"@semantic-release/exec#semantic-release@>=15.9.0 <17.0.0" doesn't satisfy found match of "[email protected]"

Expectation

@semantic-release/exec@beta is compatible with semantic-release@beta (eg: 16.0.0-beta.45).

Additional Details

This appears to also have been an issue for the release notes plugin: semantic-release/release-notes-generator#154

However, since they don't have a beta branch it was released as part of the package (not in a beta release).

Proposed Fix

Update the peerDependencies on the beta branch of this plugin to match the release notes.

Release Notes Plugin

https://github.com/semantic-release/release-notes-generator/blob/b9319f2b854bb0bb2cff0dfc4cab415b2cb1b049/package.json#L75-L77

Current Value

exec/package.json

Lines 61 to 63 in 8349d07

"peerDependencies": {
"semantic-release": ">=15.9.0 <17.0.0"
},

Proposed Change

  "peerDependencies": {
    "semantic-release": ">=15.9.0 <16.0.0 || >=16.0.0-beta <17.0.0"
  },

Run several commands

Is it possible to run several commands (i.e. array)?

Using && with a long list is not so convenient.

exec overrides default steps

With a package.json release configuration like below, the exec plugin seems to override certain default steps:

{
  "plugins": [,
    ["@semantic-release/exec", {
      "verifyConditionsCmd": "./verify.sh",
      "publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"
    }],
  ]
}

This is the same config as used in the README, but without the @semantic-release/commit-analyzer and @semantic-release/release-notes-generator plugins. Here is a log excerpt from a build using a configuration like above:

[5:44:43 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/exec"
[5:44:43 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/exec"
[5:44:43 PM] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

When I include the plugins included in the README, things work like usual. When I do not include the exec module at all, the release notes and commit analysis plugins are called by default. Why does the exec module override them?

Steps not defined

I'm trying to use exec to bake the version number into my application before build.

package.json

  "release": {
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/github",
        {
          "assets": [
            {
              "path": "build/release.tar.gz"
            }
          ]
        }
      ],
      [
        "@semantic-release/exec",
        {
          "prepareCmd": "sed -i 's/<version>/${steps.semantic.outputs.new_release_version}/' src/index.ts && npm run build && cd build && tar -czf release.tar.gz **/* ../package.json ../package-lock.json"
        }
      ]
    ]
  }

I've defined these plugins in package.json to do so, however when trying to execute a build using this procedure the build crashes saying steps is not defined in exec.

[4:16:14 PM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/exec"
[4:16:14 PM] [semantic-release] › ✖  Failed step "prepare" of plugin "@semantic-release/exec"
[4:16:14 PM] [semantic-release] › ✖  An error occurred while running semantic-release: ReferenceError: steps is not defined
    at eval (lodash.templateSources[0]:9:10)
    at module.exports (/home/runner/work/Shubot/Shubot/node_modules/@semantic-release/exec/lib/exec.js:7:39)
    at prepare (/home/runner/work/Shubot/Shubot/node_modules/@semantic-release/exec/index.js:54:11)
    at validator (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/lib/plugins/normalize.js:34:30)
    at /home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/semantic-release/lib/plugins/pipeline.js:37:40
    at next (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/p-reduce/index.js:17:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  pluginName: '@semantic-release/exec'
}
##[error]ReferenceError: steps is not defined

exec lodash template compilation variables

Trying to access one of the variables shown in the example:

"publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"

in this project like so:

"success": [
      "@semantic-release/github",
      [
        "@semantic-release/exec",
        {
          "successCmd": "npm start -- --branch ${options.branch}"
        }
      ]
    ],

when this step run, I see this in the travis run:

[11:16:33 PM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/exec"
[11:16:33 PM] [semantic-release] [@semantic-release/exec] › ℹ  Call script npm start -- --branch 
> @kibibit/[email protected] start /home/travis/build/Kibibit/announce-it
> node ./bin/announce-it-cli.js "--branch"

which looks like the template variable wasn't injected there. I tried looking for a test in the exec.test.js file to look if this is tested (and see if the variable name is wrong in the docs) but couldn't find anything.

Is there a variable I can inject with the branch name? options.branch?

Thanks!

failCmd doesn't get invoked when publishCmd returns non-zero error code

semantic-release-errorlog.log
I'm trying to create a workflow where I should be able to notify on success and failure of publishCmd, but failCmd doesn't get invoked at all when publishCmd returns non-zero error code. Instead the semantic-release crashes with error stack trace.

{
  "ci": false,
  "branches": [
    "test",
    {
      "name": "beta",
      "prerelease": true
    },
    {
      "name": "alpha",
      "prerelease": true
    }
  ],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "docs/CHANGELOG.md"
      }
    ],
    [
      "@semantic-release/exec",
      {
        "failCmd": "./fail.py",
        "successCmd": "./success.py",
        "publishCmd": "./deploy.sh \"${nextRelease.version}\"",
        "verifyConditionsCmd": "./verify.py"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": [
          "docs/CHANGELOG.md"
        ],
        "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}

Allow for arrays of commands

It would be nice if instead of:

{
  "@semantic-release/exec",
  {
    "prepareCmd":  "sed -i 's/<version>/${nextRelease.version}/' package.json && npm run build && tar -czf my.tar.gz * && zip my.zip *"
  }
}

You could specify an array of commands instead:

{
  "@semantic-release/exec",
  {
    "prepareCmd":  [
      "sed -i 's/<version>/${nextRelease.version}/' package.json",
      "npm run build",
      "tar -czf my.tar.gz *",
      "zip my.zip *"
    ]
  }
}

Is it possible to give the previous step output as argument to the script?

Can we pass the previous step output as an argument to the script?

get-data:
    runs-on: ubuntu-latest
    outputs:
      change-log: ${{ steps.update-specs.outputs.change-log }}
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      - name: Test
        run: |
          echo "::set-output name=change-log::testChange"
  release:
    runs-on: ubuntu-latest
    needs: [get-data]
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          git pull
          npm install
      - name: semanticRelease
        run: |
          npm i --save-dev @semantic-release/exec
          npx semantic-release -t \${version}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json:

"plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
      [
        "@semantic-release/changelog",
        {
          "changelogFile": "CHANGES.md"
        }
      ],
      [
        "@semantic-release/npm",
        {
          "npmPublish": false
        }
      ],
      "@semantic-release/github",
      [
        "@semantic-release/git",
        {
          "assets": [
            "CHANGES.md",
            "package.json"
          ],
          "message": "chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
        }
      ],
      [
        "@semantic-release/exec",
        {
          "successCmd": "node .github/scripts/build.js ${nextRelease.version}"  // Here Can we pass the change-log variable of get-data step?
        }
      ]
    ]

When exactly is publishCmd run?

I would like to run a command that uses the newly updated package.json version and write it into a file that is added to git to be included as part of the release commit, is it possible to do so with exec?

My use case is that I'm building a hybrid app where semantic-release would bump the package.json version, I would then like to use the new package.json version to update the native android & ios versions based on that and push that to git as part of the release commit, is that something I can accomplish with exec, or do I manually need to trigger my script after release as a separate commit?

I tried setting that as part of the publishCmd but it didn't work, it seems to be run either too early before the new package.json version is set or too late after the commit has already been made
PS: npmPublish is set to false

Output is not streamed

I am running webpack with the exec plugin as a prepare step, to avoid running it when no release needs to be done. It can take multiple minutes.

Currently, during the whole time, no output is shown. Once the command finishes, all output is shown at once.

This makes it hard to watch the build progress or determine if it hanged (and CI might kill the build if it does not output anything for longer than 10min).

Expected: Output should be streamed.

Passing stdio: 'inherit' to execa (or stdio: [stdout, stderr]) should do the trick.

Allow to set cwd

This would reduce boilerplate of cd at the beginning of cmd, if the package is in a subfolder.

Shell variables

Is this all available shell variables?
Part of README:
${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}

If not, is there a summary of them?
I'm looking for variable that holds changelog.

Issue with running scripts?

Hi,

I'm having issue with following your example:

 "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/exec", {
      "verifyConditionsCmd": "./verify.sh",
      "publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"
    }],
  ]
}

my verify.sh

echo 'verifying'

When i execute it, i get the following:

image

Does the verify.sh need to be defined a certain way? Its also located in the same level as where the .releaserc is set?

Thanks,
Derek

Passing enviornment variables to the script

My "publishCmd" script needs environment variables to be set to run properly.
How could I pass them to the script?

I've tried the code below but with no success:

"@semantic-release/exec",
{
    "publishCmd": "node ./scripts/publish.js ${env.CI_ENVIRONMENT_VARIABLE}"
}

publish command run several times

When my publish command has a failure, exec runs it multiple times.

Package in config:

        ["@semantic-release/exec", {
            publishCmd: "npm run deploy"
        }],

In my logs I can see that after a failure, the command is simply run again, and again.. for several tries.

Here's a snippet that shows where it fails but starts another run:

    'v1.28.0: digest: sha256:73d00269eafd4d9c96fc01bc8e93b1eef57e115d6a966a21a214655b95e80af2 size: 4091\n' +
    ' • Rolling out on Kubernetes',
  stderr: 'WARNING! Your password will be stored unencrypted in /root/.docker/config.json.\n' +
    'Configure a credential helper to remove this warning. See\n' +
    'https://docs.docker.com/engine/reference/commandline/login/#credentials-store\n' +
    '\n' +
    'error: You must be logged in to the server (Unauthorized)',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  pluginName: '@semantic-release/exec'
}
Error: Command failed with exit code 1: npm run deploy
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
error: You must be logged in to the server (Unauthorized)
> @---/[email protected] deploy
> ./scripts/deploy-detect.sh
> @---/[email protected] deploy:production
> env-cmd -e production ./scripts/deploy.sh
Building and deploying docker image

semantic-release peer dependency range dependency tree error

exec/package.json

Lines 60 to 62 in f9ea421

"peerDependencies": {
"semantic-release": ">=16.0.0 <18.0.0"
},

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/semantic-release
npm ERR!   dev semantic-release@"18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer semantic-release@">=16.0.0 <18.0.0" from @semantic-release/[email protected]
npm ERR! node_modules/@semantic-release/exec
npm ERR!   dev @semantic-release/exec@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

should be resolved with #185

parseJson crashes when stdout is not json

[Semantic release]: Call script NODE_ENV=production yarn build
$ node scripts/build.js
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  56.64 KB  build/static/js/main.c965c6ba.js
  788 B     build/static/css/main.1746b4f4.css

The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:

  "homepage" : "http://myname.github.io/myapp",

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

Find out more about deployment here:

  http://bit.ly/2vY88Kr

[Semantic release]: An error occurred while running semantic-release: { JSONError: Unexpected token $ in JSON at position 0 while parsing near '$ node scripts/build...'
    at module.exports (/home/circleci/repo/node_modules/@semantic-release/exec/node_modules/parse-json/index.js:26:19)
    at publish (/home/circleci/repo/node_modules/@semantic-release/exec/index.js:55:26)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7) name: 'JSONError' }
error Command failed with exit code 1.

Rsync / ZIP not found

I'm experiencing an issue where basic commands are not found when executing from within my shell script. Rsync and ZIP namely

#!/bin/sh

if [ $# -eq 0 ]
  then
    echo "No arguments supplied"
    exit
fi

... 
Environment variables
...

echo "Syncing files..."
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded

echo "Generating zip file..."
cd "$BUILD_PATH" || exit
zip -q -r "${SLUG}.zip" "$SLUG/"
module.exports = {
  tagFormat: "${version}",
  branch: "master",
  plugins: [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/npm", { 
      npmPublish: false 
    }],
    ["@semantic-release/exec", {
      "publishCmd": "chmod +x ./bin/build-zip.sh && ./bin/build-zip.sh ${nextRelease.version}"
    }],
    ["@semantic-release/github", {
      "assets": [
        {"path": "build/build.zip", "label": "Bundle"}
      ]
    }]
  ]
};

Is this perhaps a directory or permissions issue?

Using the exec plugin to update changelog not working

Hi guys,

I am using the exec plugin to change the git url and few other things in the generated changelog.
Unfortunately the updated changelog is not added and commitet to git.

My script looks like this

const fs = require("fs").promises;
const path = require("path");
const showdown = require("showdown");
const converter = new showdown.Converter();

const pathToChangelog = path.resolve(__dirname, "../CHANGELOG.md");
const pathToChangelogHtml = path.resolve(__dirname, "../CHANGELOG.html");
const regex = /https\/\/:my-wrong-url/gi;
const humanVisitableBitbucketUrl =
  "my-new-bitbucket-url";

const getChangelog = async path => await fs.readFile(path, { encoding: "utf-8" });
const replaceUrl = (changelog, regex, url) => changelog.replace(regex, url);
const writeChangelog = async (changelog, path) => await fs.writeFile(path, changelog);
const convertMarkdownToHtml = changelog => converter.makeHtml(changelog);
const writeHtml = async (html, path) => await fs.writeFile(path, html);

(async () => {
  const changelog = await getChangelog(pathToChangelog);
  const modifiedChangelog = replaceUrl(changelog, regex, humanVisitableBitbucketUrl);
  await writeChangelog(modifiedChangelog, pathToChangelog);
  const html = convertMarkdownToHtml(modifiedChangelog);
  await writeHtml(html, pathToChangelogHtml);
})();

The exec config in my package.json looks like this:

"release": {
    "branch": "develop",
    "tagFormat": "${version}",
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/changelog",
        {
          "changelogFile": "CHANGELOG.md"
        }
      ],
      [
        "@semantic-release/npm",
        {
          "npmPublish": false
        }
      ],
      "@semantic-release/git",
      [
        "@semantic-release/exec",
        {
          "prepareCmd": "node tools/modify-changelog.js"
        }
      ]
    ],
    "preset": "angular"
  }

What am I doing wrong? Am I using the wrong hook? Do I need to add and commit the files myself? Any help is very much appreciated :)

An in-range update of sinon is breaking the build 🚨

Version 4.1.6 of sinon was just published.

Branch Build failing 🚨
Dependency sinon
Current Version 4.1.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 10 commits.

  • 68c37ed Update docs/changelog.md and set new release id in docs/_config.yml
  • cd8ae51 Add release documentation for v4.1.6
  • 29e80be 4.1.6
  • a5c59a5 Update History.md and AUTHORS for new release
  • 0ae60b6 Merge pull request #1653 from mroderick/upgrade-dependencies
  • dcd4191 Upgrade browserify to latest
  • a316f02 Upgrade markdownlint-cli to latest
  • 78ebdb3 Upgrade lint-staged to latest
  • fcf967b Upgrade dependency supports-color
  • 7c3cb4f Enable StaleBot with default configuration (#1649)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.