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

Setup goreleaser to update homebrew #1121

Merged

Conversation

baduker
Copy link
Contributor

@baduker baduker commented Nov 21, 2023

This pull request introduces the brews section to the GoReleaser configuration file for the Exercism project.
The added brews section defines the Homebrew formula for Exercism project which will automate the process of updating the Homebrew package whenever a new release is created on GitHub.

This fixes issue #1102.

Copy link

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Nov 21, 2023
@@ -120,5 +120,17 @@ release:
# Default is `{{.Tag}}`
name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"

# brews:
# We do not use the brew config, which is for taps, not core forumulas.
brews:
Copy link
Member

Choose a reason for hiding this comment

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

is there any way we can test this?

Copy link
Contributor Author

@baduker baduker Nov 22, 2023

Choose a reason for hiding this comment

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

As far as I'm concerned, I am not aware of a way to explicitly test brews section locally. However, I use this

goreleaser release --snapshot --clean --verbose

Running this command with the proposed changes should give you verbose output, including a section on homebrew tap formula. Speaking of which, it's called repository now as brews.tap is deprecated. To reproduce run goreleaser check and read https://goreleaser.com/deprecations#brewstap

Note: I need to comment out this section:

#signs:
#  - artifacts: checksum
#    args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]

As I don't have access to Env.GPG_FINGERPRINT and without this gpg complains and goreleaser fails locally.

Running the above command with the proposed changes in this PR, gives me the following (redacted for brevity):

[output shortened]

• homebrew tap formula
    • token type                                     type=github
    • calculating checksum for dist/exercism-0.0.0-SNAPSHOT-83a63ba-linux-armv6.tar.gz
    • guessing install                               install=[bin.install "exercism"]
    • calculating checksum for dist/exercism-0.0.0-SNAPSHOT-83a63ba-linux-x86_64.tar.gz
    • guessing install                               install=[bin.install "exercism"]
    • calculating checksum for dist/exercism-0.0.0-SNAPSHOT-83a63ba-darwin-x86_64.tar.gz
    • guessing install                               install=[bin.install "exercism"]
    • calculating checksum for dist/exercism-0.0.0-SNAPSHOT-83a63ba-linux-arm64.tar.gz
    • guessing install                               install=[bin.install "exercism"]
    • calculating checksum for dist/exercism-0.0.0-SNAPSHOT-83a63ba-darwin-arm64.tar.gz
    • guessing install                               install=[bin.install "exercism"]
    • writing                                        formula=dist/homebrew/Formula/exercism.rb
    • added new artifact                             name=exercism.rb type=Brew Tap path=dist/homebrew/Formula/exercism.rb

[output shortened]

This indicates that the brews section is being processed correctly and the actual versioned release should generate and publish a homebrew-tap recipe into a repository.

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Well, we'll see when we do a release then! Excited about this

@ErikSchierboom ErikSchierboom merged commit 6e178aa into exercism:main Nov 23, 2023
7 checks passed
@ErikSchierboom
Copy link
Member

@baduker Unfortunately, the homebrew part failed: https://github.com/exercism/cli/actions/runs/7912951304/job/21600762816 How do we fix it?

@ErikSchierboom
Copy link
Member

PR submitted to fix this: #1130

@baduker
Copy link
Contributor Author

baduker commented Feb 17, 2024

@ErikSchierboom this should fix the homebrew issue: 1e1623a

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.

2 participants