Anton
Anton

Reputation: 2341

GitHub releases with generated files

I have a GitHub repo and would like to use GitHub Actions to create a release with a generated file included:

  1. push a commit with a tag
  2. the GitHub Action starts
  3. it runs yarn run build (generates dist/index.js)
  4. release is created that includes the dist folder

So far, I have not been able to do this. I've been able to use "marvinpinto/action-automatic-releases@latest" action to package the dist folder as an additional asset, but that's not it.

I want the Source code (tar.gz) in the GitHub release to contain the dist folder.

What I'm trying to do is use this generated asset as a yarn dependency, which works if I use the Source Code (tar.gz) but not if I use the additional generated asset.

enter image description here

Upvotes: 2

Views: 1893

Answers (1)

bk2204
bk2204

Reputation: 76804

The entries your images show that are labeled “Source code (tar.gz)” and “Source code (zip)” are autogenerated from the contents of the repository and contain only and exactly what's in the repository. They can't be modified in any way because they aren't persisted: they may be regenerated in the future. That's also why they may change (so, for example, the hash of the contents need not be stable).

If you want to include additional dependencies in your tarball, simply upload your own source release that contains the generated files. Many projects do this for various reasons, and you can do it, too.

Upvotes: 1

Related Questions