Skip to content

Commit 30ee247

Browse files
committed
feat(gui): add GUI release workflow + app icon config
- Add release-gui.yml GitHub Action for DMG packaging - Add custom app icon (1024x1024) - Add build/appicon.png and build/darwin config for CI/CD - Update .gitignore to allow build config files - Remove wails build tags from main.go and app.go - Update wails.json version to 1.0.2
1 parent d4f4d60 commit 30ee247

File tree

10 files changed

+266
-8
lines changed

10 files changed

+266
-8
lines changed

.github/workflows/release-gui.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Release GUI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-gui' # Trigger on tags like v1.0.2-gui
7+
workflow_dispatch: # Allow manual trigger
8+
inputs:
9+
version:
10+
description: 'Version number (e.g., 1.0.2)'
11+
required: true
12+
default: '1.0.2'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build-macos:
19+
name: Build macOS App
20+
runs-on: macos-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: '1.21'
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '18'
34+
35+
- name: Install Wails CLI
36+
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
37+
38+
- name: Install frontend dependencies
39+
working-directory: ./frontend
40+
run: npm ci
41+
42+
- name: Build Wails App (macOS ARM64)
43+
run: |
44+
~/go/bin/wails build -platform darwin/arm64
45+
echo "✅ Built ARM64 app"
46+
47+
- name: Build Wails App (macOS AMD64)
48+
run: |
49+
~/go/bin/wails build -platform darwin/amd64 -o "Mac Dev Cleaner-amd64"
50+
echo "✅ Built AMD64 app"
51+
52+
- name: Get version
53+
id: version
54+
run: |
55+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
56+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
57+
else
58+
# Extract version from tag (v1.0.2-gui -> 1.0.2)
59+
VERSION=$(echo "${GITHUB_REF#refs/tags/v}" | sed 's/-gui$//')
60+
echo "version=$VERSION" >> $GITHUB_OUTPUT
61+
fi
62+
63+
- name: Create DMG (ARM64)
64+
run: |
65+
cd build/bin
66+
# Create DMG using hdiutil (built-in macOS)
67+
hdiutil create \
68+
-volname "Mac Dev Cleaner" \
69+
-srcfolder "Mac Dev Cleaner.app" \
70+
-ov -format UDZO \
71+
"Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-arm64.dmg"
72+
echo "✅ Created ARM64 DMG"
73+
74+
- name: Create DMG (AMD64)
75+
run: |
76+
cd build/bin
77+
# Rename AMD64 app directory if exists
78+
if [ -d "Mac Dev Cleaner-amd64.app" ]; then
79+
hdiutil create \
80+
-volname "Mac Dev Cleaner" \
81+
-srcfolder "Mac Dev Cleaner-amd64.app" \
82+
-ov -format UDZO \
83+
"Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-amd64.dmg"
84+
echo "✅ Created AMD64 DMG"
85+
fi
86+
87+
- name: List build artifacts
88+
run: |
89+
ls -la build/bin/
90+
ls -la build/bin/*.dmg || true
91+
92+
- name: Upload DMG artifacts
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: macos-dmg
96+
path: build/bin/*.dmg
97+
retention-days: 7
98+
99+
- name: Create GitHub Release
100+
if: startsWith(github.ref, 'refs/tags/')
101+
uses: softprops/action-gh-release@v1
102+
with:
103+
name: "Mac Dev Cleaner GUI v${{ steps.version.outputs.version }}"
104+
body: |
105+
## Mac Dev Cleaner GUI v${{ steps.version.outputs.version }}
106+
107+
### Downloads
108+
- **Apple Silicon (M1/M2/M3)**: `Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-arm64.dmg`
109+
- **Intel Mac**: `Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-amd64.dmg`
110+
111+
### Installation
112+
1. Download the appropriate DMG for your Mac
113+
2. Open the DMG file
114+
3. Drag "Mac Dev Cleaner" to Applications folder
115+
4. Launch from Applications
116+
117+
### Note
118+
On first launch, you may need to right-click and select "Open" to bypass Gatekeeper.
119+
files: |
120+
build/bin/*.dmg
121+
draft: false
122+
prerelease: false
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ bin/
2121

2222
# production
2323
/build
24+
# But keep Wails icon and config for CI/CD
25+
!build/appicon.png
26+
!build/darwin/
27+
!build/darwin/**
2428

2529
# misc
2630
.DS_Store

app-icon.png

1.8 MB
Loading

app.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build wails
2-
// +build wails
3-
41
package main
52

63
import (

build/appicon.png

5.69 MB
Loading

build/darwin/Info.dev.plist

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2+
<plist version="1.0">
3+
<dict>
4+
<key>CFBundlePackageType</key>
5+
<string>APPL</string>
6+
<key>CFBundleName</key>
7+
<string>{{.Info.ProductName}}</string>
8+
<key>CFBundleExecutable</key>
9+
<string>{{.OutputFilename}}</string>
10+
<key>CFBundleIdentifier</key>
11+
<string>com.wails.{{.Name}}</string>
12+
<key>CFBundleVersion</key>
13+
<string>{{.Info.ProductVersion}}</string>
14+
<key>CFBundleGetInfoString</key>
15+
<string>{{.Info.Comments}}</string>
16+
<key>CFBundleShortVersionString</key>
17+
<string>{{.Info.ProductVersion}}</string>
18+
<key>CFBundleIconFile</key>
19+
<string>iconfile</string>
20+
<key>LSMinimumSystemVersion</key>
21+
<string>10.13.0</string>
22+
<key>NSHighResolutionCapable</key>
23+
<string>true</string>
24+
<key>NSHumanReadableCopyright</key>
25+
<string>{{.Info.Copyright}}</string>
26+
{{if .Info.FileAssociations}}
27+
<key>CFBundleDocumentTypes</key>
28+
<array>
29+
{{range .Info.FileAssociations}}
30+
<dict>
31+
<key>CFBundleTypeExtensions</key>
32+
<array>
33+
<string>{{.Ext}}</string>
34+
</array>
35+
<key>CFBundleTypeName</key>
36+
<string>{{.Name}}</string>
37+
<key>CFBundleTypeRole</key>
38+
<string>{{.Role}}</string>
39+
<key>CFBundleTypeIconFile</key>
40+
<string>{{.IconName}}</string>
41+
</dict>
42+
{{end}}
43+
</array>
44+
{{end}}
45+
{{if .Info.Protocols}}
46+
<key>CFBundleURLTypes</key>
47+
<array>
48+
{{range .Info.Protocols}}
49+
<dict>
50+
<key>CFBundleURLName</key>
51+
<string>com.wails.{{.Scheme}}</string>
52+
<key>CFBundleURLSchemes</key>
53+
<array>
54+
<string>{{.Scheme}}</string>
55+
</array>
56+
<key>CFBundleTypeRole</key>
57+
<string>{{.Role}}</string>
58+
</dict>
59+
{{end}}
60+
</array>
61+
{{end}}
62+
<key>NSAppTransportSecurity</key>
63+
<dict>
64+
<key>NSAllowsLocalNetworking</key>
65+
<true/>
66+
</dict>
67+
</dict>
68+
</plist>

build/darwin/Info.plist

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2+
<plist version="1.0">
3+
<dict>
4+
<key>CFBundlePackageType</key>
5+
<string>APPL</string>
6+
<key>CFBundleName</key>
7+
<string>{{.Info.ProductName}}</string>
8+
<key>CFBundleExecutable</key>
9+
<string>{{.OutputFilename}}</string>
10+
<key>CFBundleIdentifier</key>
11+
<string>com.wails.{{.Name}}</string>
12+
<key>CFBundleVersion</key>
13+
<string>{{.Info.ProductVersion}}</string>
14+
<key>CFBundleGetInfoString</key>
15+
<string>{{.Info.Comments}}</string>
16+
<key>CFBundleShortVersionString</key>
17+
<string>{{.Info.ProductVersion}}</string>
18+
<key>CFBundleIconFile</key>
19+
<string>iconfile</string>
20+
<key>LSMinimumSystemVersion</key>
21+
<string>10.13.0</string>
22+
<key>NSHighResolutionCapable</key>
23+
<string>true</string>
24+
<key>NSHumanReadableCopyright</key>
25+
<string>{{.Info.Copyright}}</string>
26+
{{if .Info.FileAssociations}}
27+
<key>CFBundleDocumentTypes</key>
28+
<array>
29+
{{range .Info.FileAssociations}}
30+
<dict>
31+
<key>CFBundleTypeExtensions</key>
32+
<array>
33+
<string>{{.Ext}}</string>
34+
</array>
35+
<key>CFBundleTypeName</key>
36+
<string>{{.Name}}</string>
37+
<key>CFBundleTypeRole</key>
38+
<string>{{.Role}}</string>
39+
<key>CFBundleTypeIconFile</key>
40+
<string>{{.IconName}}</string>
41+
</dict>
42+
{{end}}
43+
</array>
44+
{{end}}
45+
{{if .Info.Protocols}}
46+
<key>CFBundleURLTypes</key>
47+
<array>
48+
{{range .Info.Protocols}}
49+
<dict>
50+
<key>CFBundleURLName</key>
51+
<string>com.wails.{{.Scheme}}</string>
52+
<key>CFBundleURLSchemes</key>
53+
<array>
54+
<string>{{.Scheme}}</string>
55+
</array>
56+
<key>CFBundleTypeRole</key>
57+
<string>{{.Role}}</string>
58+
</dict>
59+
{{end}}
60+
</array>
61+
{{end}}
62+
</dict>
63+
</plist>

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
22
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
3+
github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY=
4+
github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E=
35
github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
46
github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
57
github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 h1:JFgG/xnwFfbezlUnFMJy0nusZvytYysV4SCS2cYbvws=
@@ -16,6 +18,8 @@ github.com/charmbracelet/x/ansi v0.10.1 h1:rL3Koar5XvX0pHGfovN03f5cxLbCF2YvLeyz7
1618
github.com/charmbracelet/x/ansi v0.10.1/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
1719
github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
1820
github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
21+
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ=
22+
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
1923
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
2024
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
2125
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=

main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build wails
2-
// +build wails
3-
41
package main
52

63
import (

wails.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Mac Dev Cleaner",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"author": {
55
"name": "thanhdevapp",
66
"email": "thanhdevapp@gmail.com"
@@ -11,5 +11,6 @@
1111
"frontend:install": "npm install",
1212
"frontend:build": "npm run build",
1313
"frontend:dev:watcher": "npm run dev",
14-
"frontend:dir": "./frontend"
14+
"frontend:dir": "./frontend",
15+
"go:build:tags": "wails"
1516
}

0 commit comments

Comments
 (0)