github icon indicating copy to clipboard operation
github copied to clipboard

Can't use variables in asset path

Open Andy-L opened this issue 3 years ago • 3 comments

I'm trying to filter assets to only those that match the new version, e.g.:

plugins:
 - '@semantic-release/commit-analyzer'
 - '@semantic-release/release-notes-generator'
 - - '@semantic-release/github'
   - assets:
      - {"path": '**/build/libs/*${nextRelease.version}*.jar'}

but I just get an error:

[1:56:24 PM] [semantic-release] [@semantic-release/github] › ✖  The asset **/build/libs/*${nextRelease.version}*.jar cannot be read, and will be ignored.

I tried escaping the braces, e.g. {"path": '**/build/libs/*$\{nextRelease.version\}*.jar'} and alternate lodash syntax, e.g. {"path": '**/build/libs/*<%= nextRelease.version %>*.jar'} but with the same results.

Andy-L avatar Apr 30 '21 19:04 Andy-L

Out of curiosity, why keeping in builds folder previous versions?

kickapoo avatar May 01 '21 18:05 kickapoo

First we create a build with which to run tests (using a snapshot version). Only if the tests pass do we run semantic-release to repackage with the generated version and publish the release.

Andy-L avatar May 03 '21 01:05 Andy-L