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
234 changes: 234 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
name: Release

on:
push:
tags:
- 'v*.*.*' # Trigger on version tags like v1.0.0
workflow_dispatch: # Allow manual triggering
inputs:
version:
description: 'Version number (e.g., 1.0.0)'
required: true
default: '1.0.0'

jobs:
build-and-release:
runs-on: macos-14

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Install Android SDK
run: |
brew install android-sdk
echo "ANDROID_HOME=/usr/local/share/android-sdk" >> $GITHUB_ENV
echo "/usr/local/share/android-sdk/platform-tools" >> $GITHUB_PATH

- name: Extract version number
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/v}"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build unsigned release package
run: |
cd Scripts
chmod +x package-release.sh
./package-release.sh "${{ env.VERSION }}"

- name: Build signed release package
if: ${{ secrets.SIGNING_IDENTITY != '' }}
env:
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
cd Scripts
./package-release.sh "${{ env.VERSION }}"

- name: Calculate checksums
id: checksums
run: |
cd Build/Distribution

# Check which files were created
UNSIGNED_FILE="Xamrock-Studio-${{ env.VERSION }}.zip"
SIGNED_FILE="Xamrock-Studio-${{ env.VERSION }}-Signed.zip"

if [ -f "$UNSIGNED_FILE" ]; then
UNSIGNED_SHA256=$(shasum -a 256 "$UNSIGNED_FILE" | cut -d ' ' -f 1)
echo "unsigned_sha256=$UNSIGNED_SHA256" >> $GITHUB_OUTPUT
echo "has_unsigned=true" >> $GITHUB_OUTPUT
fi

if [ -f "$SIGNED_FILE" ]; then
SIGNED_SHA256=$(shasum -a 256 "$SIGNED_FILE" | cut -d ' ' -f 1)
echo "signed_sha256=$SIGNED_SHA256" >> $GITHUB_OUTPUT
echo "has_signed=true" >> $GITHUB_OUTPUT
fi

- name: Create Release Notes
id: release_notes
run: |
cat > release_notes.md << 'EOF'
## Xamrock Studio v${{ env.VERSION }}

### 📥 Downloads

EOF

# Add signed version if available
if [ "${{ steps.checksums.outputs.has_signed }}" = "true" ]; then
cat >> release_notes.md << 'EOF'
**Recommended: Signed & Notarized** (Best for non-technical users)
- Download: `Xamrock-Studio-${{ env.VERSION }}-Signed.zip`
- ✅ **No security warnings** - Double-click to install
- ✅ Verified by Apple
- 📦 Includes iOS & Android test frameworks

EOF
fi

# Add unsigned version
if [ "${{ steps.checksums.outputs.has_unsigned }}" = "true" ]; then
cat >> release_notes.md << 'EOF'
**Open Source Build** (For developers & contributors)
- Download: `Xamrock-Studio-${{ env.VERSION }}.zip`
- ⚠️ Requires manual security approval (see instructions below)
- 📦 Includes iOS & Android test frameworks

EOF
fi

cat >> release_notes.md << 'EOF'

### 🚀 Installation

EOF

# Signed version instructions
if [ "${{ steps.checksums.outputs.has_signed }}" = "true" ]; then
cat >> release_notes.md << 'EOF'
**Signed Version:**
1. Download `Xamrock-Studio-${{ env.VERSION }}-Signed.zip`
2. Double-click to extract
3. Drag **Xamrock Studio.app** to Applications folder
4. Double-click to open - **no additional steps needed!** ✨

EOF
fi

# Unsigned version instructions
if [ "${{ steps.checksums.outputs.has_unsigned }}" = "true" ]; then
cat >> release_notes.md << 'EOF'
**Unsigned Version:**
1. Download `Xamrock-Studio-${{ env.VERSION }}.zip`
2. Double-click to extract
3. Drag **Xamrock Studio.app** to Applications folder
4. **Right-click** the app → Select **"Open"** → Click **"Open"** in the dialog
- This is required only on first launch
- macOS will remember your choice for future launches

<details>
<summary>Why do I need to right-click?</summary>

The unsigned version uses ad-hoc signing for open-source distribution. macOS Gatekeeper requires this one-time approval. This is normal for free/open-source Mac apps.

If you prefer a smoother experience, download the signed version above.
</details>

EOF
fi

cat >> release_notes.md << 'EOF'

### ✅ Requirements

**macOS**
- macOS 14.6 or later

**iOS Testing**
- Xcode 14.0 or later

**Android Testing**
- Android SDK Platform Tools (`adb`)
- Java JDK 17 or later

### 🔒 Checksums

Verify your download with SHA256:

EOF

if [ "${{ steps.checksums.outputs.has_signed }}" = "true" ]; then
cat >> release_notes.md << 'EOF'
**Signed version:**
```
${{ steps.checksums.outputs.signed_sha256 }} Xamrock-Studio-${{ env.VERSION }}-Signed.zip
```

EOF
fi

if [ "${{ steps.checksums.outputs.has_unsigned }}" = "true" ]; then
cat >> release_notes.md << 'EOF'
**Unsigned version:**
```
${{ steps.checksums.outputs.unsigned_sha256 }} Xamrock-Studio-${{ env.VERSION }}.zip
```

EOF
fi

cat >> release_notes.md << 'EOF'

Verify:
```bash
shasum -a 256 Xamrock-Studio-*.zip
```
EOF

# Expand variables in the markdown
eval "echo \"$(cat release_notes.md)\"" > release_notes_final.md

echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
cat release_notes_final.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
name: Xamrock Studio v${{ env.VERSION }}
body: ${{ env.RELEASE_NOTES }}
draft: false
prerelease: false
files: |
Build/Distribution/Xamrock-Studio-${{ env.VERSION }}*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: xamrock-studio-${{ env.VERSION }}
path: Build/Distribution/*.zip
retention-days: 90
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
2 changes: 2 additions & 0 deletions AndroidTestHost/.gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Sun Jan 04 22:58:59 PST 2026
gradle.version=9.2.1
Binary file not shown.
Binary file added AndroidTestHost/.gradle/file-system.probe
Binary file not shown.
Empty file.
57 changes: 57 additions & 0 deletions AndroidTestHost/BUILD_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Building Android Test APKs

## Option 1: Using Android Studio (Recommended)

1. **Open the project:**
- Android Studio should have opened the `AndroidTestHost` folder
- Wait for Gradle sync to complete

2. **Build the APKs:**
- Open the Terminal in Android Studio (View → Tool Windows → Terminal)
- Run: `./gradlew assembleDebug assembleDebugAndroidTest`

OR

- Build → Make Project (Cmd+F9)
- Then in Terminal: `./gradlew assembleDebugAndroidTest`

3. **Find the built APKs:**
- `app/build/outputs/apk/debug/app-debug.apk`
- `app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk`

4. **Copy APKs to Xamrock Studio bundle:**
```bash
mkdir -p "/Users/kiloloco/Library/Developer/Xcode/DerivedData/Studio-dgcncnmufbhmpxfrqnyqamtlrojx/Build/Products/Debug/Xamrock Studio.app/Contents/Resources/AndroidTestHost"

cp app/build/outputs/apk/debug/app-debug.apk "/Users/kiloloco/Library/Developer/Xcode/DerivedData/Studio-dgcncnmufbhmpxfrqnyqamtlrojx/Build/Products/Debug/Xamrock Studio.app/Contents/Resources/AndroidTestHost/"

cp app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk "/Users/kiloloco/Library/Developer/Xcode/DerivedData/Studio-dgcncnmufbhmpxfrqnyqamtlrojx/Build/Products/Debug/Xamrock Studio.app/Contents/Resources/AndroidTestHost/"
```

## Option 2: Using Homebrew Gradle

If Android Studio doesn't work:

```bash
# Install Gradle
brew install gradle

# Build APKs
cd AndroidTestHost
gradle assembleDebug assembleDebugAndroidTest

# Copy APKs (same as above)
```

## Verification

After copying, check that the APKs exist:
```bash
ls -la "/Users/kiloloco/Library/Developer/Xcode/DerivedData/Studio-dgcncnmufbhmpxfrqnyqamtlrojx/Build/Products/Debug/Xamrock Studio.app/Contents/Resources/AndroidTestHost/"
```

You should see:
- `app-debug.apk` (~2-5 MB)
- `app-debug-androidTest.apk` (~2-5 MB)

Now restart Xamrock Studio and try recording on Android!
59 changes: 59 additions & 0 deletions AndroidTestHost/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.xamrock.testhost'
compileSdk 34

defaultConfig {
applicationId "com.xamrock.testhost"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

packagingOptions {
resources {
excludes += ['META-INF/LICENSE.md', 'META-INF/LICENSE-notice.md']
}
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'

// Testing dependencies
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.3.0'

// NanoHTTPD for embedded HTTP server
androidTestImplementation 'org.nanohttpd:nanohttpd:2.3.1'

// JSON parsing
androidTestImplementation 'com.google.code.gson:gson:2.10.1'
}
11 changes: 11 additions & 0 deletions AndroidTestHost/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Keep test-related classes
-keep class com.xamrock.testhost.** { *; }
-keep class androidx.test.** { *; }
-keep class org.junit.** { *; }
Loading