darewreck
darewreck

Reputation: 2614

Is it possible to generate artifacts without publishing with Semantic-release?

I'm currently using semantic-release for versioning of my react library.
https://github.com/semantic-release/semantic-release

Question: Is it possible to generate the artifacts without publishing it?

For example, in my use case I would like to generate: - Version Release Number (@semantic-release/commit-analyzer) - tar file that will be publish to npm (@semantic-release/npm) - change log (@semantic-release/release-notes-generator)

If you run the dry run option, it will print the version release number and the change log to console, but I want to store it to a file. One workaround is I could pipe the results and then parse, but it'll be nice if it can pass the plugin could put the data in a file during the dry run.

The dry run won't run the publish stage which is where the files get tar'ed up.

Any Advice appreciated, Thanks, Derek

Upvotes: 2

Views: 2451

Answers (2)

ton_K
ton_K

Reputation: 99

// In your package.json file add the following property which ensures that npm will not publish

"private": "true"

// In your github action's workflow/release.yml file use the following to store your tar file

- run: | 
      mkdir -p ~/new/artifact
      echo ${{contents_of_your_file}} > ~/new/artifact/yourtarfile

  - uses: actions/upload-artifact@v2
    with:
      name: artifactname
      path: '~/new/**/*'

  - name: download
    uses: actions/download-artifact@v1
    with:
      name: artifactname
      path: '~/new/**/*'

Upvotes: 1

Pierre Vanduynslager
Pierre Vanduynslager

Reputation: 929

You can use the npmPublish option of the @semantic-release/npm plugin. This will generate the tar file for the npm package but it won't publish it to the npm registry.

Upvotes: 2

Related Questions