Skip to content

fix(release): use full clone for changelog generation #6

fix(release): use full clone for changelog generation

fix(release): use full clone for changelog generation #6

Workflow file for this run

name: Release
on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]*'
- '!*-*'
jobs:
release:
runs-on: macos-15
permissions:
contents: write
steps:
- name: Checkout repository (with submodules)
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Select latest Xcode (Swift 6.2+)
run: |
LATEST_XCODE=$(ls -d /Applications/Xcode*.app | sort -V | tail -1)
echo "Selecting $LATEST_XCODE"
sudo xcode-select -s "$LATEST_XCODE"
swift --version
- name: Install dependencies
run: brew install cmake libomp rust
- name: Set up Ruby (for xcpretty)
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
- name: Install xcpretty
run: gem install xcpretty
- name: Build Rust autocorrect dylib
run: |
mkdir -p build
cargo build -p autocorrect-swift --release --target aarch64-apple-darwin \
--manifest-path=asian-autocorrect/Cargo.toml
cp ./asian-autocorrect/target/aarch64-apple-darwin/release/libautocorrect_swift.dylib \
./build/libautocorrect_swift.dylib
install_name_tool -id "@rpath/libautocorrect_swift.dylib" ./build/libautocorrect_swift.dylib
codesign --force --sign - ./build/libautocorrect_swift.dylib
- name: Copy libomp
run: |
cp /opt/homebrew/opt/libomp/lib/libomp.dylib ./build/libomp.dylib
install_name_tool -id "@rpath/libomp.dylib" ./build/libomp.dylib
codesign --force --sign - ./build/libomp.dylib
- name: Resolve SPM packages and apply patches
run: |
chmod +x ./Scripts/resolve_and_patch.sh
./Scripts/resolve_and_patch.sh
- name: Build app (Release)
run: |
xcodebuild -scheme OpenSuperMLX -configuration Release -jobs 8 \
-derivedDataPath build -quiet \
-destination 'platform=macOS,arch=arm64' \
-skipPackagePluginValidation -skipMacroValidation \
-UseModernBuildSystem=YES \
-clonedSourcePackagesDirPath SourcePackages \
-skipUnavailableActions \
CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \
build 2>&1 | xcpretty --simple --color
- name: Ad-hoc sign app bundle
run: |
APP_PATH="build/Build/Products/Release/OpenSuperMLX.app"
if [[ ! -d "$APP_PATH" ]]; then
echo "❌ App not found at $APP_PATH"
exit 1
fi
# --deep signs all nested code (dylibs, frameworks, bundles) inside-out.
# Appropriate for ad-hoc signing; avoids the find -type f bug with .framework dirs.
codesign --force --deep --sign - "$APP_PATH"
echo "✅ Ad-hoc signed app bundle"
codesign -vv "$APP_PATH"
- name: Create DMG
run: |
APP_PATH="build/Build/Products/Release/OpenSuperMLX.app"
if [[ ! -d "$APP_PATH" ]]; then
echo "❌ App not found at $APP_PATH"
exit 1
fi
mkdir -p dmg_staging
cp -R "$APP_PATH" dmg_staging/
ln -s /Applications dmg_staging/Applications
hdiutil create -volname "OpenSuperMLX" -srcfolder dmg_staging \
-ov -format UDZO OpenSuperMLX.dmg
shasum -a 256 OpenSuperMLX.dmg > OpenSuperMLX.dmg.sha256
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${GITHUB_REF_NAME}"
SHA256=$(cut -d' ' -f1 OpenSuperMLX.dmg.sha256)
# Find previous stable tag (exclude tags with hyphens: -test, -beta, -rc, etc.)
PREV_TAG=$(git tag --sort=-v:refname | grep -v '-' | grep -v "^${VERSION}$" | head -1)
if [[ -n "$PREV_TAG" ]]; then
CHANGELOG=$(git log "${PREV_TAG}..${VERSION}" --pretty=format:"- %s" --no-merges)
else
CHANGELOG=$(git log "d20968b..${VERSION}" --pretty=format:"- %s" --no-merges)
fi
NOTES=$(cat <<EOF
## What's Changed
${CHANGELOG}
---
### Installation via Homebrew (Recommended)
\`\`\`bash
brew tap axot/tap
brew install --cask opensupermlx
\`\`\`
### Manual Installation
1. Download **OpenSuperMLX.dmg** below
2. Open the DMG and drag OpenSuperMLX to Applications
3. On first launch: right-click the app → **Open** (required for unsigned apps)
4. Grant microphone and accessibility permissions when prompted
### Requirements
- macOS 15.1 or later
- Apple Silicon (M1/M2/M3/M4) Mac
EOF
)
gh release create "$VERSION" \
--title "Release $VERSION" \
--notes "$NOTES" \
OpenSuperMLX.dmg \
OpenSuperMLX.dmg.sha256
- name: Update Homebrew tap
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
env:
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
set -e
VERSION="${GITHUB_REF_NAME}"
SHA256=$(cut -d' ' -f1 OpenSuperMLX.dmg.sha256)
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/axot/homebrew-tap.git" /tmp/homebrew-tap
mkdir -p /tmp/homebrew-tap/Casks
cat > /tmp/homebrew-tap/Casks/opensupermlx.rb <<CASK
cask "opensupermlx" do
version "${VERSION}"
sha256 "${SHA256}"
url "https://github.com/axot/OpenSuperMLX/releases/download/#{version}/OpenSuperMLX.dmg"
name "OpenSuperMLX"
desc "Real-time audio transcription for macOS powered by MLX on Apple Silicon"
homepage "https://github.com/axot/OpenSuperMLX"
depends_on macos: ">= :sequoia"
depends_on arch: :arm64
app "OpenSuperMLX.app"
zap trash: [
"~/Library/Application Scripts/org.axot.OpenSuperMLX",
"~/Library/Application Support/org.axot.OpenSuperMLX",
"~/Library/Preferences/org.axot.OpenSuperMLX.plist",
]
end
CASK
cd /tmp/homebrew-tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/opensupermlx.rb
git diff --cached --quiet || git commit -m "Update opensupermlx to ${VERSION}"
git push