Can I use the templates in asset's path config?
See original GitHub issueHi there, thanks for the great project!
I have the following files:
dist/file1-v1.0.0.zip
dist/file1-v1.0.1.zip
dist/file1-v1.1.0.zip
...etc
I wanted to attach the last generated file on the release in question. For that, I had this configuration:
[
"@semantic-release/github",
{
"assets": "dist/*.zip"
}
]
With the config above, all my files in dist/
folder were getting attached to each release in Github’s release page. So far so good, it was working as expected and it was a silly mistake of mine.
Then I tried to fix it by doing the following:
[
"@semantic-release/github",
{
"assets": "dist/*${nextRelease.version}.zip"
}
]
But it didn’t work – no assets were attached to the next release. Am I missing something? Are templates even supported in path
?
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How do I properly set assets paths? - Craft CMS Stack Exchange
Uploading images through the CP works great, and images go to the correct folder, and are viewable in the CP. In the template...
Read more >Accessing Files Inside Templates - Helm
In the previous section we looked at several ways to create and access named templates. This makes it easy to import one template...
Read more >Assets - Maizzle
Any files that you add to your template sources will be copied over to the root of the build destination directory, so you...
Read more >What is the proper way to link big template assets into rails erb ...
Rails.application.configure do config.assets.precompile += %w[common.js admin.js ... For them you can use a configuration .js.erb file.
Read more >Using your own theme assets for help center - Zendesk help
You can reference an uploaded asset in the theme's style.css file or in its templates. In style.css, you use asset path variables provided ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gr2m would you be opposed to a PR to also call
template
on the asset paths before actually globbing them?No, you can’t use the template strings when resolving files, because they are not replaced and passed verbatim: https://github.com/semantic-release/github/blob/32654fb26dbba597170408ab181255ae863ed748/lib/publish.js#L51-L60
I recommend to store assets with an unversioned name define individual asset entries, with a name property that contains the desired name.
Here is an example of how I use it in a project: https://github.com/bifravst/firmware/blob/8632a44c5201c24c554c06861cbb32db11682b26/package.json#L44-L90