-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathTaskfile.yml
More file actions
215 lines (202 loc) · 7.97 KB
/
Copy pathTaskfile.yml
File metadata and controls
215 lines (202 loc) · 7.97 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
version: '3'
includes:
common: ../Taskfile.yml
vars:
# Signing configuration - edit these values for your project
# SIGN_IDENTITY: "Developer ID Application: Your Name (TEAM_ID)"
# NOTARIZATION_PROFILE: "notarization-profile-name"
#
# Password/API Key is stored securely in system keychain. Run: wails3 setup signing
tasks:
build:
summary: Builds the application for macOS
deps:
- task: common:go:mod:tidy
- task: common:build:frontend
vars:
BUILD_FLAGS:
ref: .BUILD_FLAGS
DEV:
ref: .DEV
- task: common:generate:icons
cmds:
# Check if building universal binary
- |
if [ "{{.ARCH}}" = "universal" ]; then
echo "Building universal binary..."
# Build for amd64
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}-amd64
# Build for arm64
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}-arm64
# Merge with lipo
lipo -create -output {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}-amd64 {{.BIN_DIR}}/{{.APP_NAME}}-arm64
# Clean up intermediate files
rm -f {{.BIN_DIR}}/{{.APP_NAME}}-amd64 {{.BIN_DIR}}/{{.APP_NAME}}-arm64
else
# Build for specific architecture
go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}
fi
- task: create:app:bundle
vars:
BUILD_FLAGS: '{{if eq .DEV "true"}}-buildvcs=false -gcflags=all="-l"{{else}}-tags production -trimpath -buildvcs=false -ldflags="-w -s"{{end}}'
env:
GOOS: darwin
CGO_ENABLED: 1
GOARCH: '{{if ne .ARCH "universal"}}{{.ARCH | default ARCH}}{{else}}{{end}}'
create:app:bundle:
summary: Creates a macOS .app bundle
internal: true
cmds:
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS/
- cp build/darwin/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources/
- |
cat > {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Info.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>{{.APP_NAME}}</string>
<key>CFBundleIconFile</key>
<string>icons.icns</string>
<key>CFBundleIdentifier</key>
<string>com.mrrss.app</string>
<key>CFBundleName</key>
<string>{{.APP_NAME}}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.24</string>
<key>CFBundleVersion</key>
<string>1.3.24</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2026</string>
<key>NSAppleEventsUsageDescription</key>
<string>MrRSS needs permission to open articles in your default web browser and execute custom feed scripts.</string>
<key>NSNetworkUsageDescription</key>
<string>MrRSS requires network access to fetch RSS feeds and update content.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>MrRSS needs access to Documents folder to import and export OPML feed lists.</string>
<key>NSDownloadsFolderUsageDescription</key>
<string>MrRSS needs access to Downloads folder to import feed lists and save exported content.</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict/>
</dict>
</dict>
</plist>
EOF
package:
summary: Packages the application into a DMG
deps:
- task: build
cmds:
- task: create:dmg
create:dmg:
summary: Creates a DMG installer
cmds:
- |
if [ -f "build/darwin/create-dmg.sh" ]; then
chmod +x build/darwin/create-dmg.sh
./build/darwin/create-dmg.sh
else
echo "Warning: create-dmg.sh not found, skipping DMG creation"
fi
run:
cmds:
- '{{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS/{{.APP_NAME}}'
sign:
summary: Signs the macOS application
desc: |
Signs the .app bundle with an Apple Developer certificate.
Configure SIGN_IDENTITY in the vars section at the top of this file.
deps:
- task: build
cmds:
- |
# Check if entitlements file exists
if [ -f "build/darwin/entitlements.plist" ]; then
echo "Signing with entitlements..."
codesign --deep --force --verify --verbose \
--sign "{{.SIGN_IDENTITY}}" \
--entitlements build/darwin/entitlements.plist \
--options runtime \
{{.BIN_DIR}}/{{.APP_NAME}}.app
else
echo "Signing without entitlements (entitlements.plist not found)..."
codesign --deep --force --verify --verbose \
--sign "{{.SIGN_IDENTITY}}" \
--options runtime \
{{.BIN_DIR}}/{{.APP_NAME}}.app
fi
preconditions:
- sh: '[ -n "{{.SIGN_IDENTITY}}" ]'
msg: "SIGN_IDENTITY is required. Set it in the vars section at the top of build/darwin/Taskfile.yml"
notarize:
summary: Notarizes the macOS application
desc: |
Notarizes the .app bundle or DMG with Apple's notarization service.
Configure NOTARIZATION_PROFILE in the vars section at the top of this file.
deps:
- task: sign
cmds:
- xcrun notarytool submit {{.BIN_DIR}}/{{.APP_NAME}}.app --keychain-profile "{{.NOTARIZATION_PROFILE}}" --wait
- xcrun stapler staple {{.BIN_DIR}}/{{.APP_NAME}}.app
preconditions:
- sh: '[ -n "{{.NOTARIZATION_PROFILE}}" ]'
msg: "NOTARIZATION_PROFILE is required. Set it in the vars section at the top of build/darwin/Taskfile.yml"
sign:dev:
summary: Signs the macOS application for development (ad-hoc signature)
desc: |
Signs the .app bundle with ad-hoc signature for local development testing.
This does not require an Apple Developer certificate.
deps:
- task: build
cmds:
- |
# Remove any existing signature
codesign --remove-signature {{.BIN_DIR}}/{{.APP_NAME}}.app 2>/dev/null || true
# Apply ad-hoc signature with entitlements
if [ -f "build/darwin/entitlements.plist" ]; then
echo "Applying ad-hoc signature with entitlements..."
codesign --deep --force --verify --verbose \
--sign - \
--entitlements build/darwin/entitlements.plist \
{{.BIN_DIR}}/{{.APP_NAME}}.app
else
echo "Applying ad-hoc signature without entitlements..."
codesign --deep --force --verify --verbose \
--sign - \
{{.BIN_DIR}}/{{.APP_NAME}}.app
fi
# Verify signature
codesign --verify --verbose {{.BIN_DIR}}/{{.APP_NAME}}.app
build:server:
summary: Builds the server version using Docker
deps:
- task: common:build:frontend
cmds:
- docker build -f Dockerfile.server -t mrrss-server:latest .
- docker create --name mrrss-server-temp mrrss-server:latest
- docker cp mrrss-server-temp:/app/mrrss-server {{.BIN_DIR}}/{{.APP_NAME}}-server
- docker rm mrrss-server-temp
preconditions:
- sh: docker info > /dev/null 2>&1
msg: "Docker is required for building the server version"
run:server:
summary: Runs the server version
deps:
- task: build:server
cmds:
- '{{.BIN_DIR}}/{{.APP_NAME}}-server'