-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (129 loc) · 4.71 KB
/
release-gui.yml
File metadata and controls
152 lines (129 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Release GUI
on:
push:
tags:
- 'v*-gui' # Trigger on tags like v1.0.2-gui
workflow_dispatch: # Allow manual trigger
inputs:
version:
description: 'Version number (e.g., 1.0.2)'
required: true
default: '1.0.2'
permissions:
contents: write
jobs:
# Backend tests (Go) - must pass before building
test-backend:
name: Backend Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Create dummy frontend directory
run: mkdir -p frontend/dist && echo "Test build" > frontend/dist/README.txt
- name: Build
run: go build -v ./cmd/... ./internal/... ./pkg/...
- name: Test
run: go test -v ./cmd/... ./internal/... ./pkg/...
# Build macOS App - only after backend tests pass
# Frontend tests run locally via pre-push hook
build-macos:
name: Build macOS App
runs-on: macos-latest
needs: [test-backend]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Install frontend dependencies
working-directory: ./frontend
run: npm install
- name: Build Wails App (macOS ARM64)
run: |
~/go/bin/wails build -platform darwin/arm64
mv "build/bin/Mac Dev Cleaner.app" "build/bin/Mac Dev Cleaner-arm64.app"
echo "✅ Built ARM64 app"
- name: Build Wails App (macOS AMD64)
run: |
~/go/bin/wails build -platform darwin/amd64
mv "build/bin/Mac Dev Cleaner.app" "build/bin/Mac Dev Cleaner-amd64.app"
echo "✅ Built AMD64 app"
- name: Get version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
# Extract version from tag (v1.0.2-gui -> 1.0.2)
VERSION=$(echo "${GITHUB_REF#refs/tags/v}" | sed 's/-gui$//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
fi
- name: Create DMG (ARM64)
run: |
cd build/bin
# Rename to clean app name for DMG
mv "Mac Dev Cleaner-arm64.app" "Mac Dev Cleaner.app"
hdiutil create \
-volname "Mac Dev Cleaner" \
-srcfolder "Mac Dev Cleaner.app" \
-ov -format UDZO \
"Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-arm64.dmg"
# Restore original name for next build
mv "Mac Dev Cleaner.app" "Mac Dev Cleaner-arm64.app"
echo "✅ Created ARM64 DMG"
- name: Create DMG (AMD64)
run: |
cd build/bin
# Rename to clean app name for DMG
mv "Mac Dev Cleaner-amd64.app" "Mac Dev Cleaner.app"
hdiutil create \
-volname "Mac Dev Cleaner" \
-srcfolder "Mac Dev Cleaner.app" \
-ov -format UDZO \
"Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-amd64.dmg"
echo "✅ Created AMD64 DMG"
- name: List build artifacts
run: |
ls -la build/bin/
ls -la build/bin/*.dmg || true
- name: Upload DMG artifacts
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: build/bin/*.dmg
retention-days: 7
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: "Mac Dev Cleaner GUI v${{ steps.version.outputs.version }}"
body: |
## Mac Dev Cleaner GUI v${{ steps.version.outputs.version }}
### Downloads
- **Apple Silicon (M1/M2/M3)**: `Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-arm64.dmg`
- **Intel Mac**: `Mac-Dev-Cleaner-${{ steps.version.outputs.version }}-amd64.dmg`
### Installation
1. Download the appropriate DMG for your Mac
2. Open the DMG file
3. Drag "Mac Dev Cleaner" to Applications folder
4. Launch from Applications
### Note
On first launch, you may need to right-click and select "Open" to bypass Gatekeeper.
files: |
build/bin/*.dmg
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}