chore: remove deprecated iOS dashboard build workflow

This commit is contained in:
Simon Larsen
2025-11-21 18:14:02 +00:00
parent b5243cec1a
commit 58a955baf7

View File

@@ -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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>OneUptime Wrapper</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style>body{font-family:system-ui, sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f5;color:#333}.
notice{max-width:480px;text-align:center;padding:1rem}</style>
</head>
<body>
<div class="notice">
<h1>Building iOS shell…</h1>
<p>The production build loads the live PWA at runtime.</p>
</div>
</body>
</html>
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 <<JSON > 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