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

Add SHA256 checksums to release artifacts #1226

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

sikha-root
Copy link
Contributor

@sikha-root sikha-root commented Feb 29, 2024

This replaces the action used in release workflows with a Go-specific release action, but the build and release process more or less remains the same as before. We effectively only add an additional checksum generation and publish step with this update.

We also remove cli_release.yml because it builds digger-cli-Linux-X64 which is the same as the digger-cli-linux-amd64 artifact built by cli_release_multiarch.yml. If this isn't desired, we can remove that commit on request.

@sikha-root
Copy link
Contributor Author

sikha-root commented Feb 29, 2024

Example release: https://github.com/317project/digger/releases/tag/v0.4.6

I guess the Windows executables automatically get an .exe extension. I can try to figure out how to override that if necessary (matrix options probably?), but really, who would run Digger on Windows....

@motatoes motatoes marked this pull request as ready for review March 3, 2024 15:59
@motatoes
Copy link
Contributor

motatoes commented Mar 3, 2024

Hey @sikha-root ! Thanks for this contribution. It looks good to me. One thing - we can't yet remove cli_release.yml although it duplicates because the action.yml downloads that specific one explicitly (see #1215). We would need to replace it with some os.arch but when running on ubuntu it doesn't actually translate to the same values that go maps to so its a peice of work to figure out in the future.

TL/DR; not yet ready to remove the cli_release.yml but rest of the changes look good

@sikha-root
Copy link
Contributor Author

@motatoes OK! I need to take care of some things with my git setup but will remove that change once I'm ready.

@motatoes
Copy link
Contributor

@motatoes OK! I need to take care of some things with my git setup but will remove that change once I'm ready.

Cool! Tag me again when ready @sikha-root

@motatoes
Copy link
Contributor

ping @sikha-root any updates? :) just need to bring back cli_release.yml and we are good to go

@motatoes
Copy link
Contributor

@sikha-root Closing for now but would love for you to re-open once the file is removed to get it merged, since I love the functionality of having a sha checksum for artefacts and it would be great to have your name on this PR :)

@motatoes motatoes closed this Apr 15, 2024
@motatoes motatoes reopened this Jun 10, 2024
@sikha-root
Copy link
Contributor Author

@motatoes thanks, I rebased and left out the commit that removed cli_release.yml.

uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish binary artifact to GitHub
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm getting anxoius about this particular change. I realise that the official action is now unmaintained but I also get anxious about using other third party actions. I'm not sure what the best course of action here is but would rather keep this change out of this PR for a future discussion on the best action to use.

What do you think ?

Copy link
Contributor Author

@sikha-root sikha-root Jun 11, 2024

Choose a reason for hiding this comment

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

I don't think there's much reason for concern when using third-party actions as long as we're pinning to the specific commit like we're doing so here. The code can't change from underneath you (as opposed to using tags that could get redefined). Unless licensing is your concern?

As for keeping this change out of the PR...that's kind of difficult since it technically is the bulk of this PR and iirc I couldn't figure out how to get and upload checksums in separate steps otherwise. But I'm more familiar with Actions now than I was when I opened this PR (using Digger actually is the first time I've used Actions) so maybe I could figure something out. Not sure.

Then again my original incentive for this PR was that I wanted to add download verification to my Ansible role for deploying self-hosted Digger before publishing it but I've recently started using the helm release so it might take a bit before I try to do anything else with this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, its mainly a security concern. The fact that its a hardcoded commit helps. I also would need to make not to not merge rennovate bumps unless the new version also reviewed. Lets merge it for now until we find a new solution


- name: Build and publish binary artifact to GitHub
id: build-and-release-binary
uses: wangyoucao577/go-release-action@8fa1e8368c8465264d64e0198208e10f71474c87 # v1.50
Copy link
Contributor

Choose a reason for hiding this comment

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

same as my other comment below

@motatoes motatoes merged commit d38a43b into diggerhq:develop Jun 12, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants