Skip to content

Commit 382e545

Browse files
joemccannclaude
andcommitted
add GitHub Actions release workflow and DMG packaging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 73ba2f4 commit 382e545

3 files changed

Lines changed: 87 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: macos-15
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Build release binary
19+
run: swift build -c release
20+
21+
- name: Create app bundle
22+
run: |
23+
APP_DIR="HumanizeBar.app"
24+
rm -rf "$APP_DIR"
25+
mkdir -p "${APP_DIR}/Contents/MacOS"
26+
mkdir -p "${APP_DIR}/Contents/Resources"
27+
28+
cp ".build/release/HumanizeBar" "${APP_DIR}/Contents/MacOS/HumanizeBar"
29+
cp "Info.plist" "${APP_DIR}/Contents/"
30+
cp "Resources/AppIcon.icns" "${APP_DIR}/Contents/Resources/AppIcon.icns"
31+
32+
codesign --force --sign - "$APP_DIR"
33+
34+
- name: Create DMG
35+
run: bash scripts/create-dmg.sh HumanizeBar.app HumanizeBar.dmg
36+
37+
- name: Upload to GitHub Release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
files: HumanizeBar.dmg
41+
generate_release_notes: true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A native macOS menu bar app that rewrites AI-generated text into natural, human-sounding prose. Paste text, pick a tone, and get rewritten output copied to your clipboard.
44

5+
**[Download the latest release (DMG)](https://github.com/joemccann/humanize/releases/latest/download/HumanizeBar.dmg)**
6+
57
<p align="center">
68
<img src=".github/banner.png" alt="Cerebras provider" width="100%" />
79
</p>

scripts/create-dmg.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Creates a DMG installer from a .app bundle.
5+
# Usage: bash scripts/create-dmg.sh [path-to.app] [output-dmg-path]
6+
#
7+
# If no arguments are given, defaults to:
8+
# App: HumanizeBar.app (in project root)
9+
# DMG: HumanizeBar.dmg (in project root)
10+
11+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
12+
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
13+
14+
APP_PATH="${1:-${PROJECT_DIR}/HumanizeBar.app}"
15+
DMG_PATH="${2:-${PROJECT_DIR}/HumanizeBar.dmg}"
16+
VOL_NAME="HumanizeBar"
17+
18+
if [[ ! -d "$APP_PATH" ]]; then
19+
echo "Error: app bundle not found at ${APP_PATH}" >&2
20+
echo "Build it first with: bash scripts/build-app.sh" >&2
21+
exit 1
22+
fi
23+
24+
echo "Creating DMG from ${APP_PATH}..."
25+
26+
# Set up staging directory
27+
STAGING_DIR=$(mktemp -d)
28+
trap 'rm -rf "$STAGING_DIR"' EXIT
29+
30+
cp -R "$APP_PATH" "${STAGING_DIR}/"
31+
ln -s /Applications "${STAGING_DIR}/Applications"
32+
33+
# Remove any existing DMG
34+
rm -f "$DMG_PATH"
35+
36+
# Create compressed DMG
37+
hdiutil create \
38+
-volname "$VOL_NAME" \
39+
-srcfolder "$STAGING_DIR" \
40+
-ov \
41+
-format UDZO \
42+
"$DMG_PATH"
43+
44+
echo "Done: ${DMG_PATH}"

0 commit comments

Comments
 (0)