Skip to content

Remove goreleaser in favor of build scripts #2143

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

Merged
merged 39 commits into from
Jun 18, 2022
Merged

Conversation

deansheather
Copy link
Member

@deansheather deansheather commented Jun 7, 2022

This PR will remove goreleaser from the repository as a dependency in favor of our own build scripts. Goreleaser is presenting many issues when we try to create releases on multiple OS types with notarized binaries.

Subtasks

  • Write build_go.sh script
  • Write build_go_matrix.sh script
  • Write archive.sh script to produce (and sign) an archive for the given binary
  • Write package.sh script to produce linux package files
  • Write build_docker.sh to build and push docker images
  • Write build_docker_multiarch.sh to create a multiarch manifest and push it
  • Write publish_release.sh to publish a release to github
  • Integrate into the release pipeline

Fixes #2289

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

I'm not sure what pain-points we're hitting with goreleaser, but I took a surface-level look at this and it looks good!

(I think that #2202 might also be easier to implement with this refactor).

One addition that could be nice is to add checks that the required tools are available beforehand (e.g. jq, codesign, gon, etc).

release_notes="
## Changelog

$(git log --no-merges --pretty=format:"- %h %s" "$old_tag..$new_tag")
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: I think it would make the release notes easier to consume if we sorted the commits by feat/fix/etc (e.g. pipe to something like | sort -t' ' -k2).

Copy link
Member Author

Choose a reason for hiding this comment

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

I've opted for trying to keep everything as close as possible to what it is with goreleaser, so instead of changing this in this PR you should open a ticket for it 😄

@deansheather deansheather marked this pull request as ready for review June 14, 2022 20:56
@deansheather deansheather requested review from mafredri and coadler June 14, 2022 20:57
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

I really like this change! You can't beat a good ol' bash script.
I'm just having some issues with the build_docker script and I'm pretty sure I'm not holding it wrong.

@deansheather deansheather requested a review from johnstcn June 16, 2022 17:38
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

🐚

Comment on lines 209 to 211
-covermode=atomic -coverprofile="gotests.coverage"
-coverpkg=./...,github.com/coder/coder/codersdk
-timeout=3m -count=$GOCOUNT -short -failfast
-timeout=5m -count=$GOCOUNT -short -failfast
Copy link
Member

Choose a reason for hiding this comment

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

non-blocking: I wonder if we should instead just use the Makefile target so we don't need to keep this in sync?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is a comment on the merge commit since I didn't touch this in my PR. Feel free to fix this in a separate PR

@deansheather deansheather merged commit 075e891 into main Jun 18, 2022
@deansheather deansheather deleted the remove-goreleaser branch June 18, 2022 19:47
@im-coder-lg
Copy link
Contributor

I get a weird error when I update to 0.7.2 now. Thought it's best to update here, since this PR added it, you might know the error. The ARM64 DEB binary is actually AMD64, so is there any good enough fix?

@deansheather
Copy link
Member Author

@im-coder-lg what error are you getting? I just ran file on the coder binary in the ARM64 deb file coder_0.7.2_linux_arm64.deb and it seems to be ARM aarch64

$ file usr/bin/coder
usr/bin/coder: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=k0_BXcFzzLqNpLqPh249/S3GdcCj7g2NOShlh19ZF/VY-298WLmx1dTIQv1goh/_CBS6aWKyuQKzIsUewky, stripped

@deansheather
Copy link
Member Author

Oh I see the issue, the architecture in the packages are hardcoded as amd64 even though it contains the correct binary. I'll absolutely fix this

@deansheather
Copy link
Member Author

Will be fixed by #2511, and once merged I will create a new release :)

@deansheather
Copy link
Member Author

Fixed for arm64 and a fix for armv7 should be released later today :)

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.

find some way to auto-update Coder in docker-compose
5 participants