Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add Ensu iOS TestFlight build

Manav Rathifc7459337504
diff --git a/.github/workflows/ensu-build.yml b/.github/workflows/ensu-build.yml
index 4cdc80b5bb..b7a00ac07e 100644
--- a/.github/workflows/ensu-build.yml
+++ b/.github/workflows/ensu-build.yml
@@ -331,8 +331,69 @@ jobs:
'{embeds: [{title: $title, description: ($body + "\n" + $download_line), color: 16633363}]}' \
| curl -fsSL -H 'Content-Type: application/json' -d @- "${DISCORD_WEBHOOK}"
+ build-ios:
+ needs: build-metadata
+ if: needs.build-metadata.outputs.should_build == 'true'
+ runs-on: macos-latest
+
+ defaults:
+ run:
+ working-directory: mobile/native/darwin/Apps/Ensu
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ needs.build-metadata.outputs.commit_sha }}
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@stable
+
+ - name: Generate iOS bindings
+ working-directory: rust
+ run: cargo codegen ensu-ios
+
+ - name: Import Apple Distribution certificate
+ uses: Apple-Actions/import-codesign-certs@5142e029c445c10ffc7149d172e540235a065466 # v7.0.0
+ with:
+ p12-file-base64: ${{ secrets.APPLE_DISTRIBUTION_CERT_BASE64 }}
+ p12-password: ${{ secrets.APPLE_DISTRIBUTION_CERT_PASSWORD }}
+
+ - name: Archive and upload Ensu to TestFlight
+ env:
+ ASC_API_KEY_BASE64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }}
+ ASC_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
+ ASC_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
+ BUILD_NUMBER: ${{ needs.build-metadata.outputs.build_number }}
+ run: |
+ key_path="${RUNNER_TEMP}/AuthKey_${ASC_KEY_ID}.p8"
+ printf '%s' "${ASC_API_KEY_BASE64}" | base64 --decode > "${key_path}"
+
+ xcodebuild archive \
+ -project Ensu.xcodeproj \
+ -scheme Ensu \
+ -configuration Release \
+ -destination 'generic/platform=iOS' \
+ -archivePath build/Ensu.xcarchive \
+ -allowProvisioningUpdates \
+ -authenticationKeyPath "${key_path}" \
+ -authenticationKeyID "${ASC_KEY_ID}" \
+ -authenticationKeyIssuerID "${ASC_ISSUER_ID}" \
+ CODE_SIGN_STYLE=Automatic \
+ CODE_SIGN_IDENTITY="Apple Distribution" \
+ CURRENT_PROJECT_VERSION="${BUILD_NUMBER}"
+
+ xcodebuild -exportArchive \
+ -archivePath build/Ensu.xcarchive \
+ -exportPath build/Export \
+ -exportOptionsPlist scripts/ExportOptions-AppStore-CI.plist \
+ -allowProvisioningUpdates \
+ -authenticationKeyPath "${key_path}" \
+ -authenticationKeyID "${ASC_KEY_ID}" \
+ -authenticationKeyIssuerID "${ASC_ISSUER_ID}"
+
mark-built-tag:
- needs: [build-metadata, build-desktop, build-android]
+ needs: [build-metadata, build-desktop, build-android, build-ios]
if: needs.build-metadata.outputs.should_build == 'true'
runs-on: ubuntu-22.04
diff --git a/mobile/native/darwin/Apps/Ensu/README.md b/mobile/native/darwin/Apps/Ensu/README.md
index 99fc3fc89d..d31a5a87e2 100644
--- a/mobile/native/darwin/Apps/Ensu/README.md
+++ b/mobile/native/darwin/Apps/Ensu/README.md
@@ -60,7 +60,7 @@ Export an IPA from the archive:
xcodebuild -exportArchive \
-archivePath build/Ensu.xcarchive \
-exportPath build/Export \
- -exportOptionsPlist ExportOptions-AppStore.plist
+ -exportOptionsPlist scripts/ExportOptions-AppStore.plist
```
### Tests
diff --git a/mobile/native/darwin/Apps/Ensu/scripts/ExportOptions-AppStore-CI.plist b/mobile/native/darwin/Apps/Ensu/scripts/ExportOptions-AppStore-CI.plist
new file mode 100644
index 0000000000..46fb30a7a4
--- /dev/null
+++ b/mobile/native/darwin/Apps/Ensu/scripts/ExportOptions-AppStore-CI.plist
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>method</key>
+ <string>app-store-connect</string>
+ <key>signingStyle</key>
+ <string>automatic</string>
+ <key>teamID</key>
+ <string>6Z68YJY9Q2</string>
+ <key>destination</key>
+ <string>upload</string>
+ <key>manageAppVersionAndBuildNumber</key>
+ <false/>
+</dict>
+</plist>
diff --git a/mobile/native/darwin/Apps/Ensu/ExportOptions-AppStore.plist b/mobile/native/darwin/Apps/Ensu/scripts/ExportOptions-AppStore.plist
similarity index 100%
rename from mobile/native/darwin/Apps/Ensu/ExportOptions-AppStore.plist
rename to mobile/native/darwin/Apps/Ensu/scripts/ExportOptions-AppStore.plist