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

chore: upload individual binaries as artifacts #3714

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented Mar 7, 2025

Description

This PR adds a workflow job that uploads the built snapshot binaries as workflow artifacts, as can be seen by following the workflow links to the summary in this PR itself.

As written, the artifacts are compressed without any intermediary folders, so downloading darwin-build_darwin_amd64_v1 is a zip file directly containing the syft binary, though one that is not notorized. To me, this seems more convenient than having intermediate directories like snapshot/build_darwin_amd64_v1/syft or build_darwin_amd64_v1/syft.

It is a separate job so it should not affect the overall workflow run times since it runs concurrently with other jobs that take longer. It only downloads the artifacts from cache, and uploads them as workflow artifacts. This seems a little odd, but there may be a performance difference in uploading to the cache vs the workflow: 4 vs ~13 seconds serially or an added ~7 seconds to npm install @actions/artifact. It may be worth revisiting this later to simply upload the workflow artifacts and forgo the cache now that it is possible to download workflow artifacts during the same workflow, but I don't think that is necessary to accomplish the main goal of having the snapshots available for testing.

Type of change

  • Chore (improve the developer experience, fix a test flake, etc, without changing the visible behavior of Syft)

Sorry, something went wrong.

@kzantow kzantow force-pushed the chore/upload-snapshot-artifacts branch 4 times, most recently from 60b86b4 to aa8cfa4 Compare March 8, 2025 03:20

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow force-pushed the chore/upload-snapshot-artifacts branch from 04e2887 to 6d613c9 Compare March 8, 2025 04:26
Signed-off-by: Keith Zantow <kzantow@gmail.com>

- run: npm install @actions/artifact@2.2.2

- uses: actions/github-script@v7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use https://github.com/actions/upload-artifact directly as an action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wagoodman the problem using upload-artifact is that you are only able to upload a single artifact -- if you give it 4 files, for example, it combines them into a single zip and uploads that. I would rather have these available for download individually so an interested party doesn't have to download all builds just to get the windows build, for example

@kzantow kzantow merged commit 9a2c2ad into anchore:main Mar 13, 2025
13 checks passed
@kzantow kzantow deleted the chore/upload-snapshot-artifacts branch March 13, 2025 16:23
@kzantow kzantow added the changelog-ignore Don't include this issue in the release changelog label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-ignore Don't include this issue in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants