Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ jobs:
mkdir -p dist
ditto -c -k --sequesterRsrc --keepParent "$app" \
"dist/android-cli-gui-v${VERSION}-${{ matrix.artifact }}.zip"
packaging/macos/make-dmg.sh "$app" "$VERSION" \
"dist/android-cli-gui-v${VERSION}-${{ matrix.artifact }}.dmg"
- name: Package (Linux)
if: runner.os == 'Linux'
shell: bash
Expand Down Expand Up @@ -191,8 +193,8 @@ jobs:

sed \
-e "s/__VERSION__/${VERSION}/g" \
-e "s/__SHA256_MACOS_ARM64__/$(sha "android-cli-gui-v${VERSION}-macos-arm64.zip")/g" \
-e "s/__SHA256_MACOS_X86_64__/$(sha "android-cli-gui-v${VERSION}-macos-x86_64.zip")/g" \
-e "s/__SHA256_MACOS_ARM64__/$(sha "android-cli-gui-v${VERSION}-macos-arm64.dmg")/g" \
-e "s/__SHA256_MACOS_X86_64__/$(sha "android-cli-gui-v${VERSION}-macos-x86_64.dmg")/g" \
packaging/homebrew/android-cli-gui.cask.rb.tmpl \
> dist/android-cli-gui.rb

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ If you installed the old formula, remove it before switching:
brew uninstall android-cli-gui
```

Prebuilt applications for macOS (Apple Silicon and Intel), binaries for Linux
and Windows, and checksums are on the
Prebuilt macOS disk images (Apple Silicon and Intel), Windows and Linux
archives, and checksums are on the
[releases page](https://github.com/RayhanHamada/android-cli-gui/releases).

## Build from source
Expand All @@ -58,6 +58,8 @@ cargo build --release
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
packaging/macos/make-app.sh target/release/android-cli-gui "$version" \
"target/Android CLI GUI.app"
packaging/macos/make-dmg.sh "target/Android CLI GUI.app" "$version" \
"target/android-cli-gui-v${version}-macos-arm64.dmg"
open "target/Android CLI GUI.app"
```

Expand Down
2 changes: 1 addition & 1 deletion packaging/homebrew/android-cli-gui.cask.rb.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cask "android-cli-gui" do
sha256 arm: "__SHA256_MACOS_ARM64__",
intel: "__SHA256_MACOS_X86_64__"

url "https://github.com/RayhanHamada/android-cli-gui/releases/download/v#{version}/android-cli-gui-v#{version}-#{arch}.zip"
url "https://github.com/RayhanHamada/android-cli-gui/releases/download/v#{version}/android-cli-gui-v#{version}-#{arch}.dmg"
name "Android CLI GUI"
desc "Unofficial GUI for the official Android CLI"
homepage "https://github.com/RayhanHamada/android-cli-gui"
Expand Down
47 changes: 47 additions & 0 deletions packaging/macos/make-dmg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# Build a drag-to-Applications disk image around a signed .app bundle.
#
# Usage: make-dmg.sh <app> <version> <output.dmg>
set -euo pipefail

if [[ $# -ne 3 ]]; then
echo "usage: $0 <app> <version> <output.dmg>" >&2
exit 2
fi

app=$1
version=$2
output=$3

if [[ "$(uname -s)" != "Darwin" ]]; then
echo "make-dmg.sh requires macOS (hdiutil)." >&2
exit 1
fi
if [[ ! -d "$app" ]]; then
echo "App bundle not found: $app" >&2
exit 1
fi
if [[ "$output" != *.dmg ]]; then
echo "Output must end in .dmg: $output" >&2
exit 1
fi

staging="$(mktemp -d)"
trap 'rm -rf "$staging"' EXIT

mkdir -p "$staging/root"
ditto "$app" "$staging/root/Android CLI GUI.app"
ln -s /Applications "$staging/root/Applications"

mkdir -p "$(dirname "$output")"
output_dir="$(cd "$(dirname "$output")" && pwd)"
output="$output_dir/$(basename "$output")"
rm -f "$output"
diskutil image create from \
--format UDZO \
--volumeName "Android CLI GUI" \
"$staging/root" \
"$output" >/dev/null
hdiutil verify "$output" >/dev/null

echo "Built $output (Android CLI GUI $version)"
Loading