Skip to content

Commit 067b7a1

Browse files
committed
build/release(windows): publish .zip; add Chocolatey package; pass creds through pipeline
Windows users expect .zip artifacts and often install via Chocolatey. Changes: - GoReleaser: publish Windows artifacts as `.zip`. - Chocolatey: add package metadata and enable publish via `CHOCOLATEY_API_KEY`. - Dagger pipeline + release workflow: forward GitHub + Chocolatey creds. - Fix recipe to reference the archive ID (not the build ID). This aligns distribution with Windows norms and makes the package pipeline turnkey once credentials are present. Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
1 parent 493773a commit 067b7a1

3 files changed

Lines changed: 47 additions & 5 deletions

File tree

.dagger/main.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,27 @@ func (m *ContainerUse) Release(ctx context.Context,
5252
// GitHub org name for package publishing, set only if testing release process on a personal fork
5353
//+default="dagger"
5454
githubOrgName string,
55+
// Chocolatey API key for Windows package publishing
56+
//+optional
57+
chocolateyApiKey *dagger.Secret,
5558
) (string, error) {
5659
// Create custom container with nix package for nix-hash binary
5760
customContainer := dag.Container().
5861
From("ghcr.io/goreleaser/goreleaser:latest").
5962
WithExec([]string{"apk", "add", "nix"})
6063

6164
// Use custom container with Goreleaser
62-
return dag.Goreleaser(m.Source, dagger.GoreleaserOpts{
65+
gr := dag.Goreleaser(m.Source, dagger.GoreleaserOpts{
6366
Container: customContainer,
6467
}).
6568
WithSecretVariable("GITHUB_TOKEN", githubToken).
66-
WithEnvVariable("GH_ORG_NAME", githubOrgName).
67-
Release().
68-
Run(ctx)
69+
WithEnvVariable("GH_ORG_NAME", githubOrgName)
70+
71+
if chocolateyApiKey != nil {
72+
gr = gr.WithSecretVariable("CHOCOLATEY_API_KEY", chocolateyApiKey)
73+
}
74+
75+
return gr.Release().Run(ctx)
6976
}
7077

7178
// Test runs the test suite

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
with:
2323
version: "latest"
2424
verb: call
25-
args: release --version "${GITHUB_REF#refs/tags/}" --github-token env:RELEASE_GITHUB_TOKEN --github-org-name=${{ github.repository_owner }}
25+
args: release --version "${GITHUB_REF#refs/tags/}" --github-token env:RELEASE_GITHUB_TOKEN --github-org-name=${{ github.repository_owner }} --chocolatey-api-key env:CHOCOLATEY_API_KEY
2626
env:
2727
RELEASE_GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
28+
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}

.goreleaser.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ archives:
3434
ids:
3535
- container-use
3636
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}"
37+
format_overrides:
38+
- goos: windows
39+
formats: [zip]
3740
files:
3841
- README.md
3942
- LICENSE
@@ -131,6 +134,37 @@ nix:
131134
--fish <($out/bin/cu completion fish) \
132135
--zsh <($out/bin/cu completion zsh)
133136
137+
# chocolateys:
138+
# - name: container-use
139+
# ids:
140+
# - container-use-archive
141+
# owners: Dagger
142+
# title: Container Use
143+
# authors: Dagger Team
144+
# project_url: https://github.com/dagger/container-use
145+
# url_template: "https://github.com/dagger/container-use/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
146+
# icon_url: https://raw.githubusercontent.com/dagger/container-use/main/docs/images/dagger-icon.png
147+
# copyright: 2025 Dagger, Inc.
148+
# license_url: https://github.com/dagger/container-use/blob/main/LICENSE
149+
# require_license_acceptance: false
150+
# project_source_url: https://github.com/dagger/container-use
151+
# docs_url: https://container-use.com/
152+
# bug_tracker_url: https://github.com/dagger/container-use/issues
153+
# tags: "container docker mcp agent development cli devtools"
154+
# summary: Containerized environments for coding agents
155+
# description: |
156+
# Container Use provides isolated, containerized environments for AI coding agents using Docker and Git.
157+
158+
# Features:
159+
# - Isolated environments for AI agents to work safely
160+
# - Git-based version control for all changes
161+
# - Docker containers for consistent development environments
162+
# - Model Context Protocol (MCP) integration
163+
# - Support for multiple popular AI coding assistants
164+
# release_notes: "https://github.com/dagger/container-use/releases/tag/{{ .Tag }}"
165+
# api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
166+
# skip_publish: auto
167+
134168
checksum:
135169
name_template: "checksums.txt"
136170

0 commit comments

Comments
 (0)