Skip to content

Commit 7e7a58f

Browse files
authored
Merge pull request #35 from Fukislim/master
Added support for building for Intel Mac (AMD64)
2 parents 1913d54 + a2fce5a commit 7e7a58f

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,29 @@ jobs:
144144
echo "📦 Building Darwin ARM64..."
145145
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.Version=v$VERSION" -o $BUILD_DIR/duckduckgo-chat-cli_v${VERSION}_darwin_arm64 ./cmd/duckchat/main.go
146146
147+
# Build for Intel Mac
148+
echo "📦 Building Darwin AMD64..."
149+
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.Version=v$VERSION" -o $BUILD_DIR/duckduckgo-chat-cli_v${VERSION}_darwin_amd64 ./cmd/duckchat/main.go
150+
147151
# Generate SHA256 hashes
148152
echo "🔐 Generating SHA256 hashes..."
149153
cd $BUILD_DIR
150154
sha256sum duckduckgo-chat-cli_v${VERSION}_windows_amd64.exe > duckduckgo-chat-cli_v${VERSION}_windows_amd64.exe.sha256
151155
sha256sum duckduckgo-chat-cli_v${VERSION}_linux_amd64 > duckduckgo-chat-cli_v${VERSION}_linux_amd64.sha256
152156
sha256sum duckduckgo-chat-cli_v${VERSION}_darwin_arm64 > duckduckgo-chat-cli_v${VERSION}_darwin_arm64.sha256
157+
sha256sum duckduckgo-chat-cli_v${VERSION}_darwin_amd64 > duckduckgo-chat-cli_v${VERSION}_darwin_amd64.sha256
153158
154159
# Create release archive
155160
echo "📚 Creating release archive..."
156161
zip duckduckgo-chat-cli_v${VERSION}_release.zip \
157162
duckduckgo-chat-cli_v${VERSION}_linux_amd64 \
158163
duckduckgo-chat-cli_v${VERSION}_darwin_arm64 \
164+
duckduckgo-chat-cli_v${VERSION}_darwin_amd64 \
159165
duckduckgo-chat-cli_v${VERSION}_windows_amd64.exe \
160166
duckduckgo-chat-cli_v${VERSION}_windows_amd64.exe.sha256 \
161167
duckduckgo-chat-cli_v${VERSION}_linux_amd64.sha256 \
162-
duckduckgo-chat-cli_v${VERSION}_darwin_arm64.sha256
168+
duckduckgo-chat-cli_v${VERSION}_darwin_arm64.sha256 \
169+
duckduckgo-chat-cli_v${VERSION}_darwin_amd64.sha256
163170
164171
echo "✅ Build v$VERSION complete!"
165172
ls -lah

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ jobs:
152152
fi
153153
154154
# Test macOS build
155+
# Test macOS ARM build
155156
GOOS=darwin GOARCH=arm64 go build -o test_darwin ./cmd/duckchat/main.go
156157
if [ -f "test_darwin" ]; then
157158
echo "✅ Darwin ARM64 build successful"
@@ -161,4 +162,14 @@ jobs:
161162
exit 1
162163
fi
163164
165+
# Test macOS Intel build
166+
GOOS=darwin GOARCH=amd64 go build -o test_darwin_amd64 ./cmd/duckchat/main.go
167+
if [ -f "test_darwin_amd64" ]; then
168+
echo "✅ Darwin AMD64 build successful"
169+
rm test_darwin_amd64
170+
else
171+
echo "❌ Darwin AMD64 build failed"
172+
exit 1
173+
fi
174+
164175
echo "🎉 All cross-compilation tests passed!"

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,19 @@ curl -LO $(curl -s https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/
167167
<details>
168168
<summary><strong>🍎 MacOS (curl)</strong></summary>
169169

170+
<br/>
171+
<strong>Apple Silicon (ARM64):</strong>
172+
170173
```bash
171174
curl -LO $(curl -s https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/releases/latest | grep -oP 'https.*darwin_arm64' | grep -oP 'https.*v[0-9]+\.[0-9]+\.[0-9]+_darwin_arm64' | head -1) && chmod +x duckduckgo-chat-cli_v*_darwin_arm64 && ./duckduckgo-chat-cli_v*_darwin_arm64
172175
```
173176

177+
<strong>Intel (AMD64):</strong>
178+
179+
```bash
180+
curl -LO $(curl -s https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/releases/latest | grep -oP 'https.*darwin_amd64' | grep -oP 'https.*v[0-9]+\.[0-9]+\.[0-9]+_darwin_amd64' | head -1) && chmod +x duckduckgo-chat-cli_v*_darwin_amd64 && ./duckduckgo-chat-cli_v*_darwin_amd64
181+
```
182+
174183
</details>
175184

176185
### 🔨 2. Build from source

scripts/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,17 @@ cd ..
4949
echo "📦 Building Darwin ARM64..."
5050
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.Version=v$VERSION" -o $BUILD_DIR/duckduckgo-chat-cli_v${VERSION}_darwin_arm64 ./cmd/duckchat/main.go
5151

52+
# Build pour Intel Mac
53+
echo "📦 Building Darwin AMD64..."
54+
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.Version=v$VERSION" -o $BUILD_DIR/duckduckgo-chat-cli_v${VERSION}_darwin_amd64 ./cmd/duckchat/main.go
55+
5256
# Création du zip de release
5357
echo "📚 Creating release archive..."
5458
cd $BUILD_DIR
5559
zip duckduckgo-chat-cli_v${VERSION}_release.zip \
5660
duckduckgo-chat-cli_v${VERSION}_linux_amd64 \
5761
duckduckgo-chat-cli_v${VERSION}_darwin_arm64 \
62+
duckduckgo-chat-cli_v${VERSION}_darwin_amd64 \
5863
duckduckgo-chat-cli_v${VERSION}_windows_amd64.exe \
5964
duckduckgo-chat-cli_v${VERSION}_windows_amd64.exe.sha256
6065
cd ..

scripts/pre-release-check.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ log_info "Checking cross-platform builds..."
6565
check "GOOS=linux GOARCH=amd64 go build -o /tmp/test_linux ./cmd/duckchat/main.go && rm -f /tmp/test_linux" "Linux AMD64 build"
6666
check "GOOS=windows GOARCH=amd64 go build -o /tmp/test_windows.exe ./cmd/duckchat/main.go && rm -f /tmp/test_windows.exe" "Windows AMD64 build"
6767
check "GOOS=darwin GOARCH=arm64 go build -o /tmp/test_darwin ./cmd/duckchat/main.go && rm -f /tmp/test_darwin" "Darwin ARM64 build"
68+
check "GOOS=darwin GOARCH=amd64 go build -o /tmp/test_darwin_amd64 ./cmd/duckchat/main.go && rm -f /tmp/test_darwin_amd64" "Darwin AMD64 build"
6869

6970
# Git verification
7071
log_info "Checking Git..."

0 commit comments

Comments
 (0)