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

Migrate GitHub build action to use GoReleaser #27

Merged
merged 6 commits into from
Jul 15, 2021
Merged

Conversation

frenck
Copy link
Member

@frenck frenck commented Jul 13, 2021

This PR migrates the GitHub Action for building the OS Agent to use GoReleaser.

  • Add GoReleaser
  • Set up for our supported architectures
  • Added Debian packages creation, including handling of services and dbus configs on install/removal of the package
  • Publish build artifacts to GitHub

Possible future improvements (needs more testing):

  • Handle CodeNotary better. Right now, it signs all resulting binaries, similar to what is done now. Ideally, we sign all resulting assets as well, which could be done from goreleaser.
  • Publish as APT repo. E.g., using CloudSmith, Fury.io or self hosted using aptly tooling or something.

I left the latter 2 out of scope for this PR, mainly to get something going.

Testing: I've been playing with the result and development on a fork
https://github.com/frenck/os-agent/releases/tag/1.8.0

@frenck frenck marked this pull request as ready for review July 13, 2021 16:19
```
go build -ldflags "-X main.version="

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`1.0.0` is used as an example here, replace that with the version of the file you downloaded.

Copy link
Member

Choose a reason for hiding this comment

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

Not needed if name_template is used

Copy link
Member Author

Choose a reason for hiding this comment

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

We should use the name template as is if we have the ambition to publish it to an apt repo. In that case, you want the files to be distinctive in order to work with multiple versions.

.github/workflows/build.yml Outdated Show resolved Hide resolved
Comment on lines +28 to +29
wrap_in_directory: true
files:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
wrap_in_directory: true
files:
wrap_in_directory: true
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ end }}'
files:

If we do not add the version to the file, instructions become simpler, and you can have a direct link to the latest asset.

Copy link
Member Author

@frenck frenck Jul 13, 2021

Choose a reason for hiding this comment

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

I don't agree with that, as the goal should be publishing it in an apt repository.
We also can't link directly, as there are multiple architectures available.

PS: The suggested name template would probably fail, as we have multiple of the same architecture (different arm versions, but still a single arm arch)

Copy link
Member Author

Choose a reason for hiding this comment

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

For example:

image

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Copy link
Member

@pvizeli pvizeli left a comment

Choose a reason for hiding this comment

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

Looks good to me

@pvizeli pvizeli merged commit 3e04d3c into main Jul 15, 2021
@pvizeli pvizeli deleted the frenck-2021-1974 branch July 15, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants