Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action artifacts output is empty #368

Closed
3 tasks done
laurentsimon opened this issue Aug 25, 2022 · 11 comments · Fixed by #369
Closed
3 tasks done

Action artifacts output is empty #368

laurentsimon opened this issue Aug 25, 2022 · 11 comments · Fixed by #369
Assignees
Labels
bug Something isn't working

Comments

@laurentsimon
Copy link

laurentsimon commented Aug 25, 2022

What happened?

I use the goreleaser Action. It seems like the artifacts output variable (https://github.com/goreleaser/goreleaser-action/blob/master/action.yml#L31) is empty. AFAIK, this used to work in the sense that this variable was populated (I tested over the past few weeks without encountering this problem).

See the test workflow here: https://github.com/laurentsimon/grpc-gateway/blob/master/.github/workflows/release.yml#L22-L43 and its failing run https://github.com/laurentsimon/grpc-gateway/runs/8019761254?check_suite_focus=true

artifacts:

META:

checksum_file:

Please let me know if I'm missing something. Thank you!

How can we reproduce this?

use the example workflow linked in the description.

goreleaser version

latest Action, v3

GoReleaser Check

  • goreleaser check shows no errors

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@laurentsimon
Copy link
Author

/cc @johanbrandhorst

@caarlos0
Copy link
Member

weird, I'll have to investigate...

meanwhile, you should be able to replace the echo there with cat dist/artifacts.json

cc/ @crazy-max

@laurentsimon
Copy link
Author

laurentsimon commented Aug 25, 2022

Thanks for the tip and quick response!

@laurentsimon
Copy link
Author

laurentsimon commented Aug 25, 2022

the cat command did not work right away, but I found the culprit. The config file uses dist: _output, so we need cat _output/artifacts.json instead. It may also be why the outputs of the workflow are empty.

@johanbrandhorst I'll send a PR for this temporary fix

@crazy-max
Copy link
Member

It seems to be populated in action ci: https://github.com/goreleaser/goreleaser-action/runs/8013357311?check_suite_focus=true#step:5:54

Code looks good too:

const artifactsFile = path.join(distpath, 'artifacts.json');

@laurentsimon Looking at logs in your workflow it doesn't seem generated: https://github.com/laurentsimon/grpc-gateway/runs/8019761254?check_suite_focus=true#step:4:50. Maybe there is an issue parsing your goreleaser yaml file in

const cfg = yaml.load(yamlfile);
return cfg.dist || 'dist';

@laurentsimon
Copy link
Author

laurentsimon commented Aug 25, 2022

@johanbrandhorst wrote the config file. The artifacts are successfully generated by goreleaser: does this not mean goreleaser understands the config? Or does it silently discard some fields if it does not understand them?

@laurentsimon
Copy link
Author

@caarlos0
Copy link
Member

@johanbrandhorst wrote the config file. The artifacts are successfully generated by goreleaser: does this not mean goreleaser understands the config? Or does it silently discard some fields if it does not understand them?

judging by this, seems like the action might allow it...

the yaml is valid for goreleaser though, as it successfully executed... @crazy-max maybe the ts yaml library is failing somehow? can we add a test using @laurentsimon's config file, and maybe log the error - or exit if parse fails? wdyt?

@laurentsimon
Copy link
Author

Fyi, this is the original config I was trying to debug https://github.com/grpc-ecosystem/grpc-gateway/blob/master/.goreleaser.yml

@crazy-max
Copy link
Member

the yaml is valid for goreleaser though, as it successfully executed... @crazy-max maybe the ts yaml library is failing somehow? can we add a test using @laurentsimon's config file, and maybe log the error - or exit if parse fails? wdyt?

Yes this might be an issue with ts-yaml, I will take a look.

@crazy-max crazy-max transferred this issue from goreleaser/goreleaser Aug 26, 2022
@laurentsimon
Copy link
Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants