release-assets action followup#67
release-assets action followup#67cdce8p wants to merge 1 commit intohome-assistant:masterfrom cdce8p:release-assets-followup
release-assets action followup#67Conversation
There was a problem hiding this comment.
Thanks!
Another note about this action (not related to this PR, but something we should consider), this is not that reusable, as this will handle wheels and sdist for python packages only.
I think it's better to refactor this action to take a single file (or all files in the folder passed), so it can be used in other types of repos like https://github.com/home-assistant/operating-system/releases/tag/7.5
And potentially split it up into 2 actions:
- Get current assets (
helpers/release-assets/list) - Upload asset(s) (
helpers/release-assets/upload)
That way the workflow that calls the action can skip build steps if the asset already exists.
I've started workin on that. Won't finish it until later today though. |
|
Does the upload action require to set the right content type? |
I think so. https://docs.github.com/en/rest/reference/releases#upload-a-release-asset -- Example job step for the frontend action - name: Upload release assets
uses: home-assistant/actions/helpers/release-assets@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
path: dist/
file_filter: "*.whl, *.tar.gz"
content_type_map: "*.whl=application/zip, *.tar.gz=application/gzip"
delete_existing_assets: trueI'll open a new actions PR for it later. |
|
Nice! Could you derive the file filter from the content map? |
Great idea! I've also change |
|
No longer needed. See #69 |
Based on feedback in #61
Replaced archived action with direct API calls.
https://docs.github.com/en/rest/reference/releases#upload-a-release-asset
Example run in my fork:
https://github.com/cdce8p/ha-frontend/runs/5559907160?check_suite_focus=true#step:3:62