diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ebfff93 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,161 @@ +# Builds every app in this repository and, on a tag, publishes them as a +# GitHub release, so a check or a CI job can install an app under test +# without building it: `gh release download -R mobiumdev/mobium-app`, or +# https://github.com/mobiumdev/mobium-app/releases/latest/download/. +# +# The file names do not carry the version, so that latest/download URL +# stays the same from release to release. Android builds are signed with a +# debug key and iOS and tvOS builds are for the simulator, unsigned: these +# are apps under test, never published to a store. The Flutter app's iOS +# build is a debug build, since Flutter builds nothing else for a simulator. +# +# A pull request that changes this file builds everything and publishes +# nothing. +name: Release + +on: + push: + tags: ['v*'] + pull_request: + paths: ['.github/workflows/release.yml'] + workflow_dispatch: + +permissions: + contents: read + +jobs: + mobiumapp-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 + with: + node-version: 24 + cache: npm + - uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: '21' + - run: npm ci --no-audit --no-fund + - run: npx expo prebuild --platform android --no-install + env: + CI: 1 + - run: ./gradlew --no-daemon assembleRelease + working-directory: android + - run: cp android/app/build/outputs/apk/release/app-release.apk MobiumApp-android.apk + - uses: actions/upload-artifact@v5 + with: + name: MobiumApp-android + path: MobiumApp-android.apk + + mobiumapp-ios: + runs-on: xcode-27 + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 + with: + node-version: 24 + cache: npm + - run: npm ci --no-audit --no-fund + - run: npx expo prebuild --platform ios + env: + CI: 1 + - run: > + xcodebuild -workspace ios/MobiumApp.xcworkspace -scheme MobiumApp + -configuration Release -sdk iphonesimulator + -destination 'generic/platform=iOS Simulator' -derivedDataPath ios/build + CODE_SIGNING_ALLOWED=NO build -quiet + - run: ditto -c -k --keepParent ios/build/Build/Products/Release-iphonesimulator/MobiumApp.app MobiumApp-ios-simulator.zip + - uses: actions/upload-artifact@v5 + with: + name: MobiumApp-ios-simulator + path: MobiumApp-ios-simulator.zip + + mobiumtv-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: '21' + - run: ./gradlew --no-daemon assembleRelease + working-directory: tv + - run: cp tv/app/build/outputs/apk/release/app-release.apk MobiumTV-android.apk + - uses: actions/upload-artifact@v5 + with: + name: MobiumTV-android + path: MobiumTV-android.apk + + mobiumtv-tvos: + runs-on: xcode-27 + steps: + - uses: actions/checkout@v5 + - run: > + xcodebuild -project MobiumTV.xcodeproj -scheme MobiumTV -configuration Release + -destination 'generic/platform=tvOS Simulator' -derivedDataPath build + CODE_SIGNING_ALLOWED=NO build -quiet + working-directory: tvos + - run: ditto -c -k --keepParent tvos/build/Build/Products/Release-appletvsimulator/MobiumTV.app MobiumTV-tvos-simulator.zip + - uses: actions/upload-artifact@v5 + with: + name: MobiumTV-tvos-simulator + path: MobiumTV-tvos-simulator.zip + + flutter: + runs-on: xcode-27 + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: '21' + - uses: subosito/flutter-action@v2 + with: + flutter-version: 3.47.1 + channel: stable + - run: flutter build apk --release + working-directory: flutter + - run: flutter build ios --simulator + working-directory: flutter + - run: | + cp flutter/build/app/outputs/flutter-apk/app-release.apk MobiumFlutter-android.apk + ditto -c -k --keepParent flutter/build/ios/iphonesimulator/Runner.app MobiumFlutter-ios-simulator-debug.zip + - uses: actions/upload-artifact@v5 + with: + name: MobiumFlutter + path: | + MobiumFlutter-android.apk + MobiumFlutter-ios-simulator-debug.zip + + appclip: + runs-on: xcode-27 + steps: + - uses: actions/checkout@v5 + - run: > + xcodebuild -project MobiumClipDemo.xcodeproj -scheme ClipDemo -configuration Release + -destination 'generic/platform=iOS Simulator' -derivedDataPath build + CODE_SIGNING_ALLOWED=NO build -quiet + working-directory: appclip + - run: ditto -c -k --keepParent appclip/build/Build/Products/Release-iphonesimulator/ClipDemo.app MobiumClipDemo-ios-simulator.zip + - uses: actions/upload-artifact@v5 + with: + name: MobiumClipDemo-ios-simulator + path: MobiumClipDemo-ios-simulator.zip + + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: [mobiumapp-android, mobiumapp-ios, mobiumtv-android, mobiumtv-tvos, flutter, appclip] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v5 + with: + path: dist + merge-multiple: true + - run: sha256sum * > SHA256SUMS + working-directory: dist + - run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --title "MobiumApp $GITHUB_REF_NAME" --generate-notes + env: + GH_TOKEN: ${{ github.token }} diff --git a/README.md b/README.md index 9cba92f..10c5a0a 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,36 @@ them. Capitals and surrounding spaces in the username are ignored. To see the errors, leave a field empty, use a username shorter than three characters or with a space in it, a password shorter than six, or a wrong password. +## Install a release + +Each tag `v*` publishes every app in this repository, built by +`.github/workflows/release.yml`. The file names stay the same from release to +release: + +| File | App | +| --- | --- | +| `MobiumApp-android.apk` | MobiumApp, Android | +| `MobiumApp-ios-simulator.zip` | MobiumApp, iOS simulator | +| `MobiumTV-android.apk` | MobiumTV, Android TV and Fire TV | +| `MobiumTV-tvos-simulator.zip` | MobiumTV, Apple TV simulator | +| `MobiumFlutter-android.apk` | the Flutter app, Android | +| `MobiumFlutter-ios-simulator-debug.zip` | the Flutter app, iOS simulator (debug: Flutter builds nothing else for one) | +| `MobiumClipDemo-ios-simulator.zip` | the App Clip demo, iOS simulator | + +```sh +gh release download -R mobiumdev/mobium-app -p MobiumApp-android.apk +adb install -r MobiumApp-android.apk + +gh release download -R mobiumdev/mobium-app -p MobiumApp-ios-simulator.zip +unzip MobiumApp-ios-simulator.zip && xcrun simctl install MobiumApp.app +``` + +Android builds are signed with a debug key and the iOS and tvOS builds are +for the simulator only: apps under test, never published to a store. For a +phone, build it as below. An APK built on your machine is signed with your +own debug key, so uninstall it before installing a release over it (MobiumApp +itself is the exception: Expo ships one debug key for every machine). + ## Build ```sh diff --git a/tv/app/build.gradle.kts b/tv/app/build.gradle.kts index c530ae5..7eb7078 100644 --- a/tv/app/build.gradle.kts +++ b/tv/app/build.gradle.kts @@ -15,6 +15,15 @@ android { versionName = "1.0" } + buildTypes { + // Signed with the debug key, as MobiumApp's own release is: an app + // under test, installed by hand or by a check, never published to a + // store. Unsigned, a release build installs nowhere. + release { + signingConfig = signingConfigs.getByName("debug") + } + } + compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17