Skip to content

Commit 9167942

Browse files
authored
Release to homebrew (#74)
* release to homebrew cask Signed-off-by: Connor Braa <connor@dagger.io> * switch config back over to point at dagger org Signed-off-by: Connor Braa <connor@dagger.io> * parameterize properly on org name Signed-off-by: Connor Braa <connor@dagger.io> * document how to release and install Signed-off-by: Connor Braa <connor@dagger.io> * use configured github token Signed-off-by: Connor Braa <connor@dagger.io> * cleanup releasing instructions Signed-off-by: Connor Braa <connor@dagger.io> --------- Signed-off-by: Connor Braa <connor@dagger.io>
1 parent 159d34d commit 9167942

File tree

5 files changed

+49
-6
lines changed

5 files changed

+49
-6
lines changed

.dagger/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ func (m *ContainerUse) Release(ctx context.Context,
4040
version string,
4141
// GitHub token for authentication
4242
githubToken *dagger.Secret,
43+
// GitHub org name for package publishing, set only if testing release process on a personal fork
44+
//+default="dagger"
45+
githubOrgName string,
4346
) (string, error) {
4447
return dag.Goreleaser(m.Source).
4548
WithSecretVariable("GITHUB_TOKEN", githubToken).
49+
WithEnvVariable("GH_ORG_NAME", githubOrgName).
4650
Release().
4751
Run(ctx)
4852
}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
with:
2323
version: "latest"
2424
verb: call
25-
args: release --version "${GITHUB_REF#refs/tags/}" --github-token env:GITHUB_TOKEN
25+
args: release --version "${GITHUB_REF#refs/tags/}" --github-token env:RELEASE_GITHUB_TOKEN
2626
env:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
RELEASE_GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,29 @@ archives:
3535
- README.md
3636
- LICENSE
3737

38+
homebrew_casks:
39+
- repository:
40+
owner: "{{ .Env.GH_ORG_NAME }}" # reconfigure if test releasing on your own fork
41+
name: homebrew-tap
42+
pull_request:
43+
enabled: true # enabled so we can publish draft releases, publish them, then merge the tap PR. to be removed later.
44+
name: container-use
45+
binary: cu
46+
skip_upload: auto # if the version is like v0.0.0-rc1, don't make the tap PR.
47+
commit_author:
48+
name: container-use-bot
49+
email: noreply@dagger.io
50+
url:
51+
template: "https://github.com/{{ .Env.GH_ORG_NAME }}/container-use/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
52+
homepage: "https://github.com/{{ .Env.GH_ORG_NAME }}/container-use"
53+
description: "Containerized environments for coding agents"
54+
hooks:
55+
post:
56+
install: |
57+
if system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
58+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/cu"]
59+
end
60+
3861
checksum:
3962
name_template: "checksums.txt"
4063

@@ -51,12 +74,15 @@ changelog:
5174
- "Merge branch"
5275

5376
release:
77+
github:
78+
owner: "{{ .Env.GH_ORG_NAME }}" # reconfigure if test releasing on your own fork
79+
name: container-use
5480
draft: true
5581
prerelease: auto
5682
mode: replace
5783
header: |
5884
## container-use {{ .Tag }}
59-
85+
6086
Download the pre-compiled binaries from the assets below.
6187
footer: |
62-
**Full Changelog**: https://github.com/dagger/container-use/compare/{{ .PreviousTag }}...{{ .Tag }}
88+
**Full Changelog**: https://github.com/{{ .Env.GH_ORG_NAME }}/container-use/compare/{{ .PreviousTag }}...{{ .Tag }}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ It's an open-source MCP server that works as a CLI tool with Claude Code, Cursor
3535

3636
## Install
3737

38+
### macOS (Homebrew - Recommended)
39+
40+
```sh
41+
brew install dagger/tap/container-use
42+
```
43+
44+
### All Platforms (Shell Script)
45+
3846
```sh
3947
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash
4048
```

RELEASING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
1. **Fetch the latest main branch**
66
```sh
7-
git checkout main
8-
git pull origin main
7+
git fetch origin main
8+
git checkout origin/main
99
```
10+
NOTE: this puts you on a detached head, which is fine for tagging and pushing the tag.
1011

1112
2. **Tag the release**
1213
```sh
@@ -28,4 +29,8 @@
2829
- Edit the draft release if needed
2930
- Click "Publish release"
3031

32+
6. **Merge the homebrew tap PR**
33+
- After publishing the release, a PR will be automatically created in [dagger/homebrew-tap](https://github.com/dagger/homebrew-tap)
34+
- Review and merge the PR to make the release available via Homebrew
35+
3136
The Dagger CI automatically handles building binaries and creating the draft release when tags are pushed.

0 commit comments

Comments
 (0)