diff --git a/.github/workflows/dashboard-ios.yaml b/.github/workflows/dashboard-ios.yaml deleted file mode 100644 index b8fa90e446..0000000000 --- a/.github/workflows/dashboard-ios.yaml +++ /dev/null @@ -1,143 +0,0 @@ -name: Build Dashboard iOS Wrapper - -on: - push: - -env: - PWA_ORIGIN: https://app.oneuptime.com - PACKAGE_ID: com.oneuptime.dashboard - HOST_NAME: app.oneuptime.com - -jobs: - build-ios: - runs-on: macos-latest - env: - MANIFEST_SOURCE_PATH: Dashboard/public/manifest.json - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Compute version numbers - id: version - run: | - set -euo pipefail - VERSION_PREFIX=$(cat VERSION_PREFIX | tr -d ' \n') - VERSION_NAME="${VERSION_PREFIX}.${GITHUB_RUN_NUMBER}" - echo "name=${VERSION_NAME}" >> $GITHUB_OUTPUT - echo "code=${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT - - - name: Extract manifest metadata - id: manifest - run: | - set -euo pipefail - node <<'NODE' > manifest.outputs - const fs = require('fs'); - const path = require('path'); - const manifestPath = path.join(process.env.GITHUB_WORKSPACE, process.env.MANIFEST_SOURCE_PATH); - const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); - const origin = process.env.PWA_ORIGIN; - const start = manifest.start_url || '/dashboard/'; - const startUrl = new URL(start, origin).toString(); - const appName = manifest.name || manifest.short_name || 'OneUptime'; - const shortName = manifest.short_name || manifest.name || 'OneUptime'; - const themeColor = manifest.theme_color || '#000000'; - const entries = { - app_name: appName, - short_name: shortName, - start_url: startUrl, - theme_color: themeColor - }; - const escape = (value) => String(value) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); - for (const [key, value] of Object.entries(entries)) { - console.log(`${key}=${escape(value)}`); - } - NODE - cat manifest.outputs >> $GITHUB_OUTPUT - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - - name: Install CocoaPods - run: | - sudo gem install cocoapods --no-document - - - name: Scaffold Capacitor iOS project - env: - APP_NAME: ${{ steps.manifest.outputs.app_name }} - SHORT_NAME: ${{ steps.manifest.outputs.short_name }} - START_URL: ${{ steps.manifest.outputs.start_url }} - THEME_COLOR: ${{ steps.manifest.outputs.theme_color }} - run: | - set -euo pipefail - WORK_DIR=ios-wrapper - rm -rf "$WORK_DIR" - mkdir "$WORK_DIR" - cd "$WORK_DIR" - npm init -y >/dev/null 2>&1 - npm install @capacitor/cli@5 @capacitor/core@5 >/dev/null 2>&1 - mkdir -p www - cat <<'HTML' > www/index.html - - - - - OneUptime Wrapper - - - - -
-

Building iOS shell…

-

The production build loads the live PWA at runtime.

-
- - - HTML - npx cap init "$APP_NAME" "$PACKAGE_ID" --web-dir=www --skip-appid-validation - rm -f capacitor.config.ts - if [[ "${START_URL}" == http:* ]]; then - CLEAR=true - else - CLEAR=false - fi - cat < capacitor.config.json - { - "appId": "${PACKAGE_ID}", - "appName": "${APP_NAME}", - "webDir": "www", - "bundledWebRuntime": false, - "server": { - "url": "${START_URL}", - "cleartext": ${CLEAR} - }, - "plugins": { - "SplashScreen": { - "launchShowDuration": 0 - } - } - } - JSON - npx cap add ios - npx cap sync ios - cd ios/App - /usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName ${SHORT_NAME}" App/App-Info.plist - /usr/libexec/PlistBuddy -c "Set :CFBundleName ${SHORT_NAME}" App/App-Info.plist - - - name: Package Xcode project - run: | - set -euo pipefail - cd ios-wrapper - zip -r ../dashboard-ios-project.zip ios >/dev/null - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: dashboard-ios-project-${{ steps.version.outputs.name }} - path: dashboard-ios-project.zip