Skip to content

Commit 154aca0

Browse files
authored
temp(ci): Enable release workflow on PR for testing build fixes (#37)
* fix(ci): Fix artifact packaging - discover actual binary name DevToolbox * allow sign app optionally
1 parent 0674136 commit 154aca0

2 files changed

Lines changed: 61 additions & 54 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,11 @@ on:
44
pull_request:
55
branches:
66
- main
7-
paths:
8-
- "**.go"
9-
- "go.mod"
10-
- "go.sum"
11-
- "**.js"
12-
- "**.jsx"
13-
- "**.ts"
14-
- "**.tsx"
15-
- "package.json"
16-
- "bun.lockb"
177
push:
188
branches:
199
- main
20-
paths:
21-
- "**.go"
22-
- "go.mod"
23-
- "go.sum"
24-
- "**.js"
25-
- "**.jsx"
26-
- "**.ts"
27-
- "**.tsx"
28-
- "package.json"
29-
- "bun.lockb"
10+
# Allow manual trigger
11+
workflow_dispatch:
3012

3113
jobs:
3214
go-tests:

.github/workflows/release.yml

Lines changed: 59 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Release
22

33
on:
4-
# Only run on version tags (releases)
54
push:
65
tags:
76
- "v*"
8-
# TEMPORARY: Run on PR for testing build fixes
7+
branches:
8+
- main
99
pull_request:
1010
branches:
1111
- main
@@ -60,6 +60,14 @@ jobs:
6060
sudo apt-get update
6161
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
6262
63+
- name: Install Task
64+
uses: arduino/setup-task@v2
65+
66+
- name: Install Frontend Dependencies
67+
run: |
68+
cd frontend && bun install
69+
shell: bash
70+
6371
- name: Install Wails CLI
6472
run: |
6573
go install github.com/wailsapp/wails/v3/cmd/wails3@latest
@@ -78,19 +86,18 @@ jobs:
7886

7987
- name: Build Application
8088
run: |
81-
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
82-
wails build -platform ${{ matrix.platform }}
83-
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
89+
# Build for current platform (native runner)
90+
if [ "${{ matrix.os }}" = "macos-latest" ]; then
8491
# macOS: Build with code signing if certificates are available
8592
if [ -n "$MACOS_CERTIFICATE" ] && [ -n "$MACOS_CERTIFICATE_PASSWORD" ]; then
8693
echo "Building with code signing..."
87-
wails build -platform ${{ matrix.platform }} -sign -signIdentity "Developer ID Application"
94+
wails build -sign -signIdentity "Developer ID Application"
8895
else
8996
echo "Building without code signing (no certificates found)..."
90-
wails build -platform ${{ matrix.platform }}
97+
wails build
9198
fi
9299
else
93-
wails build -platform ${{ matrix.platform }}
100+
wails build
94101
fi
95102
shell: bash
96103
env:
@@ -109,22 +116,27 @@ jobs:
109116
env:
110117
HAS_CERTS: ${{ secrets.MACOS_CERTIFICATE != '' && secrets.MACOS_CERTIFICATE_PASSWORD != '' }}
111118

112-
# Notarize macOS app (optional - only if secrets are configured)
119+
# Notarize macOS app (optional - only if secrets are configured and .app bundle exists)
113120
- name: Notarize macOS App
114121
if: matrix.os == 'macos-latest' && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') && env.HAS_NOTARIZE_SECRETS == 'true'
115122
run: |
116-
# Create a zip for notarization
117-
ditto -c -k --keepParent "build/bin/devtoolbox.app" "build/bin/devtoolbox.zip"
118-
119-
# Submit for notarization
120-
xcrun notarytool submit "build/bin/devtoolbox.zip" \
121-
--apple-id "${{ secrets.APPLE_ID }}" \
122-
--password "${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}" \
123-
--team-id "${{ secrets.APPLE_TEAM_ID }}" \
124-
--wait
125-
126-
# Staple the notarization ticket
127-
xcrun stapler staple "build/bin/devtoolbox.app"
123+
BINARY_NAME=$(ls bin/ | grep -i "devtoolbox" | head -1)
124+
if [ -d "bin/$BINARY_NAME.app" ]; then
125+
# Create a zip for notarization
126+
ditto -c -k --keepParent "bin/$BINARY_NAME.app" "bin/devtoolbox.zip"
127+
128+
# Submit for notarization
129+
xcrun notarytool submit "bin/devtoolbox.zip" \
130+
--apple-id "${{ secrets.APPLE_ID }}" \
131+
--password "${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}" \
132+
--team-id "${{ secrets.APPLE_TEAM_ID }}" \
133+
--wait
134+
135+
# Staple the notarization ticket
136+
xcrun stapler staple "bin/$BINARY_NAME.app"
137+
else
138+
echo "No .app bundle found, skipping notarization (binary-only build)"
139+
fi
128140
env:
129141
APPLE_ID: ${{ secrets.APPLE_ID }}
130142
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
@@ -135,33 +147,46 @@ jobs:
135147
- name: Package Artifacts
136148
run: |
137149
mkdir -p release
138-
if [ "${{ matrix.os }}" = "macos-latest" ]; then
139-
# macOS: create DMG using create-dmg
150+
151+
# Discover the actual binary name (DevToolbox, devtoolbox, etc.)
152+
BINARY_NAME=$(ls bin/ | grep -i "devtoolbox" | head -1)
153+
echo "Found binary: $BINARY_NAME"
154+
155+
if [ -z "$BINARY_NAME" ]; then
156+
echo "ERROR: Could not find devtoolbox binary in bin/"
157+
ls -la bin/
158+
exit 1
159+
fi
160+
161+
# Check if it's an .app bundle (macOS) or just a binary
162+
if [ -d "bin/$BINARY_NAME.app" ]; then
163+
# macOS with .app bundle
164+
echo "Found .app bundle, creating DMG..."
140165
brew install create-dmg
141-
# Clean up any existing files
142-
rm -f release/devtoolbox-${{ matrix.build }}.dmg
143-
rm -f /tmp/rw.*.devtoolbox-${{ matrix.build }}.dmg
144166
create-dmg \
145-
--volname "devtoolbox" \
167+
--volname "DevToolbox" \
146168
--window-pos 200 120 \
147169
--window-size 800 400 \
148170
--icon-size 100 \
149171
--app-drop-link 600 185 \
150-
"release/devtoolbox-${{ matrix.build }}.dmg" \
151-
"build/bin/devtoolbox.app"
172+
"release/DevToolbox.dmg" \
173+
"bin/$BINARY_NAME.app"
152174
elif [ "${{ matrix.os }}" = "windows-latest" ]; then
153-
# Windows: Wails already outputs .exe, just copy it
154-
cp build/bin/devtoolbox.exe release/devtoolbox-${{ matrix.build }}.exe
175+
# Windows: copy .exe
176+
cp "bin/$BINARY_NAME" "release/DevToolbox.exe"
155177
else
156-
# Linux: create AppImage or tar.gz
157-
tar -czf "release/devtoolbox-${{ matrix.build }}.tar.gz" -C build/bin devtoolbox
178+
# Linux or macOS binary (no .app): create tar.gz
179+
tar -czf "release/DevToolbox.tar.gz" -C bin "$BINARY_NAME"
158180
fi
181+
182+
echo "=== Release contents ==="
183+
ls -la release/
159184
shell: bash
160185

161186
- name: Upload Artifacts
162187
uses: actions/upload-artifact@v4
163188
with:
164-
name: devtoolbox-${{ matrix.build }}-${{ github.ref_name }}
189+
name: devtoolbox-${{ matrix.build }}
165190
path: release/*
166191

167192
# Create Release and upload assets (only on tags)

0 commit comments

Comments
 (0)