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
60 changes: 18 additions & 42 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
outputs:
is_release: ${{ steps.check_tag.outputs.is_release }}
steps:
- name: Checkout code with tags
- name: 🏗 Checkout code with tags
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history and tags
- name: Check if commit is tagged for release (v*)
- name: 🏷️ Check if commit is tagged for release (v*)
id: check_tag
run: |
# Check if any tag starting with 'v' points to the current commit HEAD
Expand All @@ -38,16 +38,16 @@ jobs:
needs: check_if_release_commit
if: needs.check_if_release_commit.outputs.is_release == 'false'
steps:
- name: Checkout code
- name: 🏗 Checkout code
uses: actions/checkout@v4

- name: Install signet app dependencies
- name: 📦 Install signet app dependencies
run: nix develop .# --command bash -c "bun install ----frozen-lockfile"

- name: Lint code
- name: Lint code
run: nix develop .# --command bash -c "bun client lint"

- name: Typecheck code
- name: 🔍 Typecheck code
run: nix develop .# --command bash -c "bun client typecheck"

android_build:
Expand All @@ -57,7 +57,7 @@ jobs:
artifact_name: ${{ steps.rename_apk.outputs.artifact_name }}
apk_filename: ${{ steps.rename_apk.outputs.apk_filename }}
steps:
- name: Checkout code
- name: 🏗 Checkout code
uses: actions/checkout@v4

# - name: Install Nix
Expand All @@ -66,18 +66,18 @@ jobs:
# - name: Enable Nix Magic Cache
# uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install signet app dependencies
- name: 📦 Install signet app dependencies
run: nix develop .# --command bash -c "bun install ----frozen-lockfile"

- name: Create sentry.properties
- name: 🔧 Create sentry.properties
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./scripts/create_sentry_properties.sh

- name: Build signet Android app
- name: 🔨 Build signet Android app
run: nix develop .# --command bash -c "bun client build:android:ci"

- name: Rename APK with timestamp
- name: 📝 Rename APK with timestamp
id: rename_apk
run: |
apk_path="client/android/app/build/outputs/apk/signet/release/app-signet-release.apk"
Expand All @@ -91,47 +91,23 @@ jobs:
echo "apk_filename=${apk_filename}" >> $GITHUB_OUTPUT
shell: bash

- name: Upload Android APK
- name: 📤 Upload Android APK
uses: actions/upload-artifact@v4
with:
name: ${{ steps.rename_apk.outputs.artifact_name }}
path: ${{ steps.rename_apk.outputs.new_path }}

ios_build:
runs-on: macOS
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Install Nix
# uses: DeterminateSystems/nix-installer-action@main

# - name: Enable Nix Magic Cache
# uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install signet app dependencies
run: nix develop .# --command bash -c "bun install ----frozen-lockfile && bun client ios:prebuild"

- name: Create sentry.properties
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./scripts/create_sentry_properties.sh

- name: Build iOS signet app
run: nix develop .# --command bash -c "bun client build:ios:signet:release"

send_telegram_notification:
runs-on: ubuntu-latest
needs: android_build
if: success()
steps:
- name: Download APK artifact
- name: 📥 Download APK artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.android_build.outputs.artifact_name }}

- name: Start local Telegram Bot API server
- name: 🚀 Start local Telegram Bot API server
run: |
docker run -d --name local-bot-api \
-p 8081:8081 \
Expand All @@ -140,22 +116,22 @@ jobs:
-e TELEGRAM_API_HASH=${{ secrets.TELEGRAM_API_HASH }} \
aiogram/telegram-bot-api:latest --local

- name: Wait for Bot API server to be ready
- name: Wait for Bot API server to be ready
run: |
echo "Waiting 5 seconds for the local Bot API server to initialize..."
sleep 5

- name: Send APK using local Bot API server
- name: 📤 Send APK using local Bot API server
run: |
curl -s -X POST "http://localhost:8081/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument" \
-F chat_id="${{ secrets.BLIXT_CHAT_ID }}" \
-F message_thread_id="${{ secrets.BLIXT_TOPIC_ID }}" \
-F document=@"${{ needs.android_build.outputs.apk_filename }}" \
-F caption="New Noah build is available!
-F caption="New Noah Android build is available!
Commit: ${{ github.sha }}
Message: ${{ github.event.head_commit.message }}"

- name: Stop and remove local Bot API server
- name: 🛑 Stop and remove local Bot API server
if: always()
run: |
echo "Stopping and removing the Docker container..."
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/noah-build-release-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build iOS Release App

on:
push:
branches:
- master
workflow_call:
outputs:
artifact_name:
description: "The name of the uploaded artifact"
value: ${{ jobs.build-release-ios.outputs.artifact_name }}
app_filename:
description: "The filename of the iOS app"
value: ${{ jobs.build-release-ios.outputs.app_filename }}

jobs:
build-release-ios:
name: Build iOS Release App
runs-on: macOS
outputs:
artifact_name: ${{ steps.set_outputs.outputs.artifact_name }}
app_filename: ${{ steps.set_outputs.outputs.app_filename }}
steps:
- name: 🏗 Checkout repository
uses: actions/checkout@v4

- name: 📦 Install dependencies
run: nix develop .# --command bash -c "bun install --frozen-lockfile"

- name: 🛠️ Build
run: nix develop .# --command bash -c "bun client ios:prebuild && bun client build:ios:ci"

- name: 📁 Prepare build output
id: set_outputs
run: |
mkdir ios-release-build
mv client/ios/build/Build/Products/Release-iphonesimulator/Noah-Signet.app ios-release-build/ios-release.app
echo "artifact_name=ios-release-app" >> $GITHUB_OUTPUT
echo "app_filename=ios-release.app" >> $GITHUB_OUTPUT

- name: 📤 Upload iOS app artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.set_outputs.outputs.artifact_name }}
path: ios-release-build/
96 changes: 96 additions & 0 deletions .github/workflows/noah-maestro-test-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Maestro Test iOS

on:
pull_request:
paths:
- "client/**"
- "scripts/**"
- ".github/workflows/**"
- "package.json"
- "bun.lock"

jobs:
build-release-ios:
name: Build iOS Release App
uses: ./.github/workflows/noah-build-release-ios.yml

maestro-test-ios:
name: Maestro Test iOS
needs: build-release-ios
runs-on: macOS
timeout-minutes: 60
permissions:
checks: read
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: 🏗 Checkout repository
uses: actions/checkout@v4

- name: 📥 Download iOS app artifact
uses: actions/download-artifact@v4
with:
name: ios-release-app
path: ios-release-build/

- name: 📦 Install Maestro
run: |
MAESTRO_VERSION=1.38.1
curl -fsSL "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH

- name: 📱 Boot iOS Simulator (iPhone 16)
run: |
DEVICE_ID=$(xcrun simctl list devices available | grep "iPhone 16" | head -n 1 | awk -F "[()]" '{print $2}')
if [ -z "$DEVICE_ID" ]; then
echo "No available simulator found for the criteria."
exit 1
fi

echo "Booting iPhone 15 simulator with DEVICE_ID=$DEVICE_ID..."
xcrun simctl boot "$DEVICE_ID" || true

TIMEOUT=120
START_TIME=$(date +%s)
echo "Waiting for simulator to boot..."

while true; do
CURRENT_TIME=$(date +%s)
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))

if [ $ELAPSED_TIME -ge $TIMEOUT ]; then
echo "Timeout: simulator failed to boot for $TIMEOUT seconds."
exit 1
fi

STATUS=$(xcrun simctl list | grep "$DEVICE_ID" | grep "(Booted)")
if [[ -n "$STATUS" ]]; then
echo "Simulator is booted!"
break
else
echo "Still waiting for the simulator to boot..."
sleep 5
fi
done

- name: 🧪 Run Maestro tests
run: nix develop .# --command bash -c "xcrun simctl install booted ios-release-build/ios-release.app && bun client maestro:test"
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 120000

- name: 🧹 Uninstall iOS app from simulator
if: always()
run: |
echo "Uninstalling Noah-Signet app with bundle ID: com.anonymous.noah.signet"
xcrun simctl uninstall booted "com.anonymous.noah.signet" || true

- name: 📤 Store debug output if failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: maestro-debug-output-ios
path: client/maestro-debug-output/**/*
include-hidden-files: true
overwrite: true
50 changes: 13 additions & 37 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
paths:
- "client/**"
- "scripts/**"
- ".github/workflows/pull-request.yml"
- ".github/workflows/**"
- "package.json"
- "bun.lock"

Expand All @@ -14,11 +14,11 @@ jobs:
outputs:
is_release: ${{ steps.check_tag.outputs.is_release }}
steps:
- name: Checkout code with tags
- name: 🏗 Checkout code with tags
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches all history and tags
- name: Check if commit is tagged for release (v*)
- name: 🏷️ Check if commit is tagged for release (v*)
id: check_tag
run: |
# Check if any tag starting with 'v' points to the current commit HEAD
Expand All @@ -36,16 +36,16 @@ jobs:
needs: check_if_release_commit
if: needs.check_if_release_commit.outputs.is_release == 'false'
steps:
- name: Checkout code
- name: 🏗 Checkout code
uses: actions/checkout@v4

- name: Install signet app dependencies
- name: 📦 Install signet app dependencies
run: nix develop .# --command bash -c "bun install ----frozen-lockfile"

- name: Lint code
- name: Lint code
run: nix develop .# --command bash -c "bun client lint"

- name: Typecheck code
- name: 🔍 Typecheck code
run: nix develop .# --command bash -c "bun client typecheck"

android_build:
Expand All @@ -55,7 +55,7 @@ jobs:
artifact_name: ${{ steps.rename_apk.outputs.artifact_name }}
apk_filename: ${{ steps.rename_apk.outputs.apk_filename }}
steps:
- name: Checkout code
- name: 🏗 Checkout code
uses: actions/checkout@v4

# - name: Install Nix
Expand All @@ -64,18 +64,18 @@ jobs:
# - name: Enable Nix Magic Cache
# uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install signet app dependencies
- name: 📦 Install signet app dependencies
run: nix develop .# --command bash -c "bun install ----frozen-lockfile"

- name: Create sentry.properties
- name: 🔧 Create sentry.properties
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./scripts/create_sentry_properties.sh

- name: Build signet Android app
- name: 🔨 Build signet Android app
run: nix develop .# --command bash -c "bun client build:android:ci"

- name: Rename APK with timestamp
- name: 📝 Rename APK with timestamp
id: rename_apk
run: |
apk_path="client/android/app/build/outputs/apk/signet/release/app-signet-release.apk"
Expand All @@ -89,32 +89,8 @@ jobs:
echo "apk_filename=${apk_filename}" >> $GITHUB_OUTPUT
shell: bash

- name: Upload Android APK
- name: 📤 Upload Android APK
uses: actions/upload-artifact@v4
with:
name: ${{ steps.rename_apk.outputs.artifact_name }}
path: ${{ steps.rename_apk.outputs.new_path }}

ios_build:
runs-on: macOS
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Install Nix
# uses: DeterminateSystems/nix-installer-action@main

# - name: Enable Nix Magic Cache
# uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install signet app dependencies
run: nix develop .# --command bash -c "bun install ----frozen-lockfile && bun client ios:prebuild"

- name: Create sentry.properties
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./scripts/create_sentry_properties.sh

- name: Build iOS signet app
run: nix develop .# --command bash -c "bun client build:ios:signet:release"
Loading