getsentry / craft

The universal Sentry release CLI 🚀
MIT License
133 stars 15 forks source link

craft needs to be more flexible with github artifact names #552

Closed joshuarli closed 2 months ago

joshuarli commented 3 months ago

github upload-artifact v3 is deprecated and v4 currently doesn't allow uploading different filepaths to the same artifact name

upstream issue: https://github.com/actions/upload-artifact/issues/478

currently craft expects the artifact name to be github.sha

this blocks:

i propose a quick fix to check for this as a prefix if {sha} isn't found (so that we don't break things): craft-{sha}-

also, this is annoying but there are going to be multiple artifact ziparchives now with craft-{sha}- for example symbolicator will need the following, and current code assumes just one artifact per revision

  - /^symbolicator-Darwin-universal$/
  - /^symbolicator-Linux-x86_64$/
  - /^symbolicator-Linux-x86_64-debug.zip$/
  - /^symbolicator-aarch64-apple-darwin-debug.zip$/
  - /^symbolicator-x86_64-apple-darwin-debug.zip$/
  - /^symbolicli-Darwin-universal$/
  - /^symbolicli-Linux-x86_64$/
  - /^symbolicli-Windows-x86_64\.exe$/
  - /^symsorter-Darwin-universal$/
  - /^symsorter-Linux-x86_64$/
  - /^symsorter-Windows-x86_64\.exe$/
  - /^wasm-split-Darwin-universal$/
  - /^wasm-split-Linux-x86_64$/
  - /^wasm-split-Windows-x86_64\.exe$/
BYK commented 3 months ago

Although less than ideal, artifacts/merge action might be a temporary solution.

joshuarli commented 2 months ago

Although less than ideal, artifacts/merge action might be a temporary solution.

Thanks for showing me this, I'm trying it out here first: https://github.com/getsentry/sentry-python/pull/3545

I think it's a good solution as it keeps craft simpler and I like the obvious idea of a unified artifact named sha. The additional overhead isn't bad: 7 second job here (2 MB artifact, 2 artifacts merged) https://github.com/getsentry/sentry-python/actions/runs/10909857400/job/30279025731?pr=3545

16s job here (400MB+ artifact, 6 artifacts merged) https://github.com/getsentry/relay/actions/runs/10910443909/job/30281749726?pr=4042

joshuarli commented 2 months ago

Closing this as I've submitted multiple PRs to respective repos using actions/merge successfully.

joshuarli commented 2 months ago

todo (remaining ones that need upload-artifact merge):