Skip to content

Commit cea258a

Browse files
committed
fix: build and install Memoryd.app in release pipeline
1 parent 17b9eef commit cea258a

4 files changed

Lines changed: 37 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,29 @@ jobs:
5454
run: |
5555
go build -ldflags "-s -w" -o memoryd-tray-darwin-${{ matrix.goarch }} ./cmd/memoryd-tray
5656
57+
- name: Download memoryd CLI from release
58+
env:
59+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
run: |
61+
TAG="${{ github.ref_name }}"
62+
VERSION="${TAG#v}"
63+
ASSET="memoryd_${VERSION}_darwin_${{ matrix.goarch }}.tar.gz"
64+
gh release download "$TAG" --pattern "$ASSET"
65+
mkdir -p bundle
66+
tar -xzf "$ASSET" -C bundle
67+
cp memoryd-tray-darwin-${{ matrix.goarch }} bundle/memoryd-tray
68+
cp bundle/memoryd bundle/memoryd
69+
70+
- name: Build .app bundle
71+
run: |
72+
bash scripts/build-release-app.sh bundle
73+
cd bundle && zip -r ../Memoryd-darwin-${{ matrix.goarch }}.zip Memoryd.app
74+
5775
- name: Upload to release
5876
env:
5977
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6078
run: |
6179
gh release upload "${{ github.ref_name }}" \
6280
memoryd-tray-darwin-${{ matrix.goarch }} \
81+
Memoryd-darwin-${{ matrix.goarch }}.zip \
6382
--clobber

install.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,23 @@ fi
141141
MEMORYD_BIN="$INSTALL_DIR/memoryd"
142142
ok "memoryd binary → $MEMORYD_BIN"
143143

144-
# Install macOS menu bar app.
144+
# Install macOS menu bar app (separate release asset).
145145
APP_DIR="/Applications"
146-
if [[ "$OS" == "darwin" && -d "$TMPDIR_DL/Memoryd.app" ]]; then
147-
pkill -f "Memoryd.app" 2>/dev/null || true
148-
sleep 0.5
149-
rm -rf "$APP_DIR/Memoryd.app"
150-
mv "$TMPDIR_DL/Memoryd.app" "$APP_DIR/Memoryd.app"
151-
ok "Memoryd.app → $APP_DIR/Memoryd.app"
146+
if [[ "$OS" == "darwin" ]]; then
147+
APP_ZIP_NAME="Memoryd-darwin-${ARCH}.zip"
148+
APP_ZIP_URL="https://github.com/$REPO/releases/download/${LATEST_TAG}/${APP_ZIP_NAME}"
149+
APP_TMPDIR=$(mktemp -d)
150+
info "Downloading Memoryd.app..."
151+
if $DOWNLOAD_QUIET -o "$APP_TMPDIR/$APP_ZIP_NAME" "$APP_ZIP_URL" 2>/dev/null; then
152+
pkill -f "Memoryd.app" 2>/dev/null || true
153+
sleep 0.5
154+
rm -rf "$APP_DIR/Memoryd.app"
155+
unzip -q "$APP_TMPDIR/$APP_ZIP_NAME" -d "$APP_DIR"
156+
ok "Memoryd.app → $APP_DIR/Memoryd.app"
157+
else
158+
info "Memoryd.app not available for $ARCH — menu bar app skipped"
159+
fi
160+
rm -rf "$APP_TMPDIR"
152161
fi
153162

154163
trap - EXIT

scripts/build-app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cat > "$APP/Contents/Info.plist" << 'PLIST'
3030
<key>CFBundleDisplayName</key>
3131
<string>Memoryd</string>
3232
<key>CFBundleIdentifier</key>
33-
<string>sh.kindling.memoryd</string>
33+
<string>io.memorydaemon.memoryd</string>
3434
<key>CFBundleVersion</key>
3535
<string>1.0</string>
3636
<key>CFBundleShortVersionString</key>

scripts/build-release-app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cat > "$APP/Contents/Info.plist" << 'PLIST'
2323
<key>CFBundleDisplayName</key>
2424
<string>Memoryd</string>
2525
<key>CFBundleIdentifier</key>
26-
<string>sh.kindling.memoryd</string>
26+
<string>io.memorydaemon.memoryd</string>
2727
<key>CFBundleVersion</key>
2828
<string>1.0</string>
2929
<key>CFBundleShortVersionString</key>

0 commit comments

Comments
 (0)