You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upload-charm action fails when it tries to upload any new resource. For example, if you have an existing charm and add a resource to that charm, you must manually upload an instance of that resource before the action will work. It would be good if the action caught this and uploaded the resource for you as expected.
To Reproduce
Add a resource to a charm, then try to upload the charm using this action
Environment
github action run for any environment
Relevant log output
Logs from a past action run, which attempted to upload resource `myfile`for the first time:
Error: Resource 'myfile' does not have any uploaded revisions.
Error: Error: Resource 'myfile' does not have any uploaded revisions.
at Charmcraft.<anonymous> (/home/runner/work/_actions/canonical/charming-actions/2.0.0-rc/dist/upload-charm/index.js:21737:23)
at Generator.next (<anonymous>)
at fulfilled (/home/runner/work/_actions/canonical/charming-actions/2.0.0-rc/dist/upload-charm/index.js:21633:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Yeah, that's a reasonable ask. We intentionally left that out of upload-charm as it would add quite a bit of complexity to the workflow files, but I do think you're right.
This doesn't need to be a hard ask in a workflow file, we just need to refactor the upload-action to change the order of operations.
As is, the upload-charm action does:
pack charm
upload resources
upload charm
To make this work for new resources as well as existing ones, we reorder things to:
pack charm
charmcraft upload charmfile.charm <--Charmhub parses this, sees the metadata.yaml with the new resource defined, and creates a new bucket for this new resource for us
charmcraft upload-resource ... to now upload an image of this new resource
charmcraft publish ... --resource newResourceName:revX to publish to latest/edge or wherever
Bug Description
The upload-charm action fails when it tries to upload any new resource. For example, if you have an existing charm and add a resource to that charm, you must manually upload an instance of that resource before the action will work. It would be good if the action caught this and uploaded the resource for you as expected.
To Reproduce
Add a resource to a charm, then try to upload the charm using this action
Environment
github action run for any environment
Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: