Skip to content

Commit da6ae34

Browse files
committed
Moved to NextJS, now compiling works with an Makefile, and new features!
1 parent d9a1464 commit da6ae34

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+8330
-538
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ jobs:
6060
go-version: '1.24.2'
6161

6262
- name: Build cross-platform binaries
63-
run: |
64-
chmod +x build.sh
65-
./build.sh
63+
run: make all
6664

6765
- name: Upload build artifacts
6866
uses: actions/upload-artifact@v3

.github/workflows/release.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,18 @@ jobs:
5959
- name: Get version from commit
6060
id: version
6161
run: |
62-
# Get version from build.sh or use timestamp
63-
VERSION=$(grep 'VERSION=' build.sh | cut -d'"' -f2 || echo "")
62+
# Get version from Makefile or use timestamp
63+
VERSION=$(grep 'VERSION :=' Makefile | cut -d' ' -f3 || echo "")
6464
if [ -z "$VERSION" ]; then
6565
VERSION="v$(date +'%Y%m%d')-$(git rev-parse --short HEAD)"
6666
else
6767
VERSION="v${VERSION}-$(git rev-parse --short HEAD)"
6868
fi
6969
echo "version=$VERSION" >> $GITHUB_OUTPUT
7070
echo "Version: $VERSION"
71-
72-
- name: Build cross-platform binaries
73-
run: |
74-
chmod +x build.sh
75-
./build.sh
76-
77-
- name: Create release archives
78-
run: |
79-
cd dist
80-
# Create archives for each platform
81-
tar -czf quiver-chat-linux-amd64.tar.gz quiver-chat-linux-amd64
82-
tar -czf quiver-chat-linux-arm64.tar.gz quiver-chat-linux-arm64
83-
tar -czf quiver-chat-macos-amd64.tar.gz quiver-chat-macos-amd64
84-
tar -czf quiver-chat-macos-arm64.tar.gz quiver-chat-macos-arm64
85-
zip quiver-chat-windows-amd64.zip quiver-chat-windows-amd64.exe
86-
zip quiver-chat-windows-arm64.zip quiver-chat-windows-arm64.exe
71+
72+
- name: Build cross-platform binaries and create archives
73+
run: make release-archives
8774

8875
- name: Generate release notes
8976
id: release_notes

Makefile

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Quiver Chat - Cross-platform Makefile
2+
# This Makefile builds executables for Windows, Linux, and macOS
3+
4+
# Variables
5+
APP_NAME := quiver-chat
6+
VERSION := 27.7.1
7+
DIST_DIR := dist
8+
FRONTEND_DIR := frontend
9+
10+
# Go build flags
11+
LDFLAGS := -ldflags="-s -w"
12+
13+
# Platforms and architectures
14+
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64
15+
16+
# Default target
17+
.PHONY: all
18+
all: clean frontend build
19+
20+
# Clean previous builds
21+
.PHONY: clean
22+
clean:
23+
@echo "🧹 Cleaning previous builds..."
24+
@rm -rf $(DIST_DIR)/
25+
@mkdir -p $(DIST_DIR)/
26+
27+
# Build the Next.js frontend
28+
.PHONY: frontend
29+
frontend:
30+
@echo "🎨 Building Next.js frontend..."
31+
@cd $(FRONTEND_DIR) && npm install && npm run build
32+
@echo "✅ Frontend build completed!"
33+
34+
# Build for all platforms
35+
.PHONY: build
36+
build: $(PLATFORMS)
37+
38+
# Build for specific platforms
39+
.PHONY: linux/amd64
40+
linux/amd64:
41+
@echo "📦 Building for Linux (amd64)..."
42+
@GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(DIST_DIR)/$(APP_NAME)-linux-amd64 .
43+
44+
.PHONY: linux/arm64
45+
linux/arm64:
46+
@echo "📦 Building for Linux (arm64)..."
47+
@GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(DIST_DIR)/$(APP_NAME)-linux-arm64 .
48+
49+
.PHONY: darwin/amd64
50+
darwin/amd64:
51+
@echo "📦 Building for macOS (amd64)..."
52+
@GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(DIST_DIR)/$(APP_NAME)-macos-amd64 .
53+
54+
.PHONY: darwin/arm64
55+
darwin/arm64:
56+
@echo "📦 Building for macOS (arm64 - Apple Silicon)..."
57+
@GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(DIST_DIR)/$(APP_NAME)-macos-arm64 .
58+
59+
.PHONY: windows/amd64
60+
windows/amd64:
61+
@echo "📦 Building for Windows (amd64)..."
62+
@GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(DIST_DIR)/$(APP_NAME)-windows-amd64.exe .
63+
64+
.PHONY: windows/arm64
65+
windows/arm64:
66+
@echo "📦 Building for Windows (arm64)..."
67+
@GOOS=windows GOARCH=arm64 go build $(LDFLAGS) -o $(DIST_DIR)/$(APP_NAME)-windows-arm64.exe .
68+
69+
# Show build results
70+
.PHONY: list
71+
list:
72+
@echo ""
73+
@echo "✅ Build completed! Binaries available in $(DIST_DIR)/ directory:"
74+
@echo ""
75+
@ls -la $(DIST_DIR)/
76+
@echo ""
77+
@echo "📋 Usage instructions:"
78+
@echo "1. Copy the appropriate binary for your platform"
79+
@echo "2. Run the binary: ./$(APP_NAME)-[platform]"
80+
@echo "3. Open your browser and navigate to http://localhost:8080"
81+
@echo "4. Choose a nickname and start chatting!"
82+
@echo ""
83+
@echo "🌐 No external dependencies required - just run and go!"
84+
85+
# Development targets
86+
.PHONY: dev
87+
dev:
88+
@echo "🚀 Starting development server..."
89+
@go run .
90+
91+
.PHONY: test
92+
test:
93+
@echo "🧪 Running tests..."
94+
@go test -v -race ./...
95+
96+
.PHONY: coverage
97+
coverage:
98+
@echo "📊 Running tests with coverage..."
99+
@go test -v -race -coverprofile=coverage.out ./...
100+
101+
# Release targets
102+
.PHONY: release-archives
103+
release-archives: build
104+
@echo "📦 Creating release archives..."
105+
@cd $(DIST_DIR) && \
106+
tar -czf $(APP_NAME)-linux-amd64.tar.gz $(APP_NAME)-linux-amd64 && \
107+
tar -czf $(APP_NAME)-linux-arm64.tar.gz $(APP_NAME)-linux-arm64 && \
108+
tar -czf $(APP_NAME)-macos-amd64.tar.gz $(APP_NAME)-macos-amd64 && \
109+
tar -czf $(APP_NAME)-macos-arm64.tar.gz $(APP_NAME)-macos-arm64 && \
110+
zip $(APP_NAME)-windows-amd64.zip $(APP_NAME)-windows-amd64.exe && \
111+
zip $(APP_NAME)-windows-arm64.zip $(APP_NAME)-windows-arm64.exe
112+
113+
# Help target
114+
.PHONY: help
115+
help:
116+
@echo "🚀 Quiver Chat Build System"
117+
@echo ""
118+
@echo "Available targets:"
119+
@echo " all - Build everything (clean + frontend + all platforms)"
120+
@echo " clean - Clean previous builds"
121+
@echo " frontend - Build Next.js frontend only"
122+
@echo " build - Build for all platforms"
123+
@echo " linux/amd64 - Build for Linux x64"
124+
@echo " linux/arm64 - Build for Linux ARM64"
125+
@echo " darwin/amd64 - Build for macOS Intel"
126+
@echo " darwin/arm64 - Build for macOS Apple Silicon"
127+
@echo " windows/amd64 - Build for Windows x64"
128+
@echo " windows/arm64 - Build for Windows ARM64"
129+
@echo " list - Show build results"
130+
@echo " dev - Start development server"
131+
@echo " test - Run tests"
132+
@echo " coverage - Run tests with coverage"
133+
@echo " release-archives - Create release archives"
134+
@echo " help - Show this help message"

0 commit comments

Comments
 (0)