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

Replace committed binary with GitHub actions workflow #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

shasheene
Copy link

@shasheene shasheene commented Nov 2, 2024

Hi @seamia,

I find this project very useful, thank for making it!

But hosting arbitrary binaries built on a developer's system within the git repository is not ideal.

The solve this, I have developed a GitHub Actions workflow file so that when a git tag release is pushed to GitHub, the binaries are automatically built for a variety of platforms and uploaded to GitHub's release page as an asset.

You can see an example of this here: https://github.com/shasheene/protodot/releases/tag/test-new-tag

Separately, there is the concept of GitHub Actions artifact, a shorter lived entity that is uploaded upon every push but only within the GitHub Actions run with some finite retention period. You can see an example of the artifact at the very bottom of this page: https://github.com/shasheene/protodot/actions/runs/11640198456

Once this PR is merged, pushing a new tag should generate a new official release automatically!

But you may want to play around with it further, typically in a separate repository, because GitHub Actions can be very finicky to develop with!

Switches to specifying a dependency to a specific git tag [1] rather than the
master branch, for a dependency which happens to be another repository of the
protodot author.

Note: the author of this specific commit is not currently familiar with go.
When trying to update the "Gopkg.lock" file it became apparent the tool is used
by Go's *deprecated* "dep" dependency management tool rather than the modern
"go mod" tool which uses "go.mod" file (which is present in this repository).
This commit still will be useful for systems which haven't been updated though.

By pointing to a specific git tag, users building locally will no longer
unknowingly pull in newer (in future, possibly API breaking) changes from that
repository, as new commits are inevitably added to its master branch.

The most recent release of protodot is v1.2.0 (2023-04-12), which based on
timestamps must have originally been built with seamia/tools v1.0.12
(2021-08-08). However, the most recent binary upload (hosted within the
repository) was commited on 2023-12-12, which indicates it was likely built
with seamia/tools v1.1.8 (2023-11-30)

[1] https://github.com/seamia/tools/tree/v1.1.8
Deletes the entire "binaries/" folder.

Hosting release binaries built from a developer's machine stored within a git
repository is hard to audit, compared to build scripts running in a continuous
integration environment (next commit).

Also binaries committed in a git repository (when not using Git Large File
Storage) causes speed problems as more binaries are added, as git is optimized
for text data not binary data.
Adds GitHub Actions workflow file to build a protodot binary for all the
operating systems and architectures currently listed in the binaries folder.

Plus Linux arm64, because that's a relatively popular platform too.
Special care taken to ensure Windows exe extension preserved.
# The former is available on each GitHub Actions workflow run. The latter is associated with only a pushed tag.

- name: Upload release artifacts except Windows
uses: actions/upload-artifact@v4
Copy link
Author

Choose a reason for hiding this comment

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

Whoops I lost the following line that's supposed to be here

        if: matrix.go-os-target != 'windows'

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.

1 participant