canonical / observability

Apache License 2.0
7 stars 11 forks source link

fix: fetch charm artifacts to proper path #162

Closed skatsaounis closed 7 months ago

skatsaounis commented 7 months ago

To release charms inside a path, the artifact should be downloaded at the same path were it was created in the build step.

To allow successful release of charms placed in . directory, the default value is used: /home/runner/work/maas-charms/maas-charms/.. That's true because the default inputs.charm-path is . and also the default value for path is GITHUB_WORKSPACE.

Links:

Current situation

...
Charm packed ok
##[debug]Set output charms = ["maas-region/maas-region_ubuntu-22.04-amd64.charm"]
##[debug]Finishing: Build charm(s)
...
With the provided path, there will be 1 file uploaded
##[debug]Root artifact directory is /home/runner/work/maas-charms/maas-charms/maas-region
Starting artifact upload
...
Directory structure has been setup for the artifact
Total number of files that will be downloaded: 1
##[debug]File: 1/1. /home/runner/work/maas-charms/maas-charms/maas-region_ubuntu-22.04-amd64.charm took 940.705 milliseconds to finish downloading
Artifact charms was downloaded to /home/runner/work/maas-charms/maas-charms
Artifact download has finished successfully
...
/usr/bin/sudo snap install charmcraft --classic --channel latest/stable
charmcraft 2.5.5 from Canonical** installed
/snap/bin/charmcraft upload --format json --release latest/edge maas-region/maas-region_ubuntu-22.04-amd64.charm
Cannot access 'maas-region/maas-region_ubuntu-22.04-amd64.charm'.
...

Expected path to make the release work

Artifact charms was downloaded to /home/runner/work/maas-charms/maas-charms/maas-region
lucabello commented 7 months ago

Have you tested that the path "${{ github.workspace }}/${{ inputs.charm-path }}" is correct and works as expected? I wouldn't want to accidentally break CI :)