Skip to content

Commit dfd7170

Browse files
committed
fix: address Capgo example deploy review
1 parent 708c620 commit dfd7170

7 files changed

Lines changed: 31 additions & 16 deletions

File tree

.github/workflows/deploy_example_app.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ permissions:
2121

2222
jobs:
2323
deploy:
24+
if: ${{ github.event_name != 'release' || !github.event.release.prerelease }}
2425
name: Deploy example app to Capgo
2526
runs-on: ubuntu-latest
2627
timeout-minutes: 10
@@ -69,10 +70,13 @@ jobs:
6970
repo_name="${GITHUB_REPOSITORY##*/}"
7071
base_bundle="$(bun -e "const fs = require('fs'); const root = JSON.parse(fs.readFileSync('package.json', 'utf8')); const example = JSON.parse(fs.readFileSync('example-app/package.json', 'utf8')); const version = [example.version, root.version].find((value) => value && value !== '0.0.0'); console.log(version || '');")"
7172
72-
if [[ -n "$release_tag" ]]; then
73+
next_bundle_version() {
74+
bun -e 'const base = process.argv[1]; const run = Number(process.argv[2] || 0); const match = base.match(/^(\d+)\.(\d+)\.(\d+)/); if (!match) { console.log(base); process.exit(0); } const [, major, minor, patch] = match; console.log(`${major}.${minor}.${Number(patch) + Math.max(run, 1)}`);' "$1" "${GITHUB_RUN_NUMBER:-0}"
75+
}
76+
if [[ -n "$base_bundle" ]]; then
77+
bundle="$(next_bundle_version "$base_bundle")"
78+
elif [[ -n "$release_tag" ]]; then
7379
bundle="${release_tag#v}"
74-
elif [[ -n "$base_bundle" ]]; then
75-
bundle="${base_bundle}-${GITHUB_RUN_NUMBER:-manual}"
7680
else
7781
bundle="${repo_name}-${GITHUB_RUN_NUMBER:-manual}"
7882
fi

example-app/android/app/capacitor.build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies {
1212
implementation project(':capacitor-camera')
1313
implementation project(':capacitor-splash-screen')
1414
implementation project(':capgo-capacitor-native-biometric')
15+
implementation project(':capgo-capacitor-updater')
1516

1617
}
1718

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
22
include ':capacitor-android'
3-
project(':capacitor-android').projectDir = new File('../../node_modules/@capacitor/android/capacitor')
3+
project(':capacitor-android').projectDir = new File('../node_modules/.bun/@capacitor+android@8.0.0+15e98482558ccfe6/node_modules/@capacitor/android/capacitor')
44

55
include ':capacitor-camera'
6-
project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android')
6+
project(':capacitor-camera').projectDir = new File('../node_modules/.bun/@capacitor+camera@8.2.0+15e98482558ccfe6/node_modules/@capacitor/camera/android')
77

88
include ':capacitor-splash-screen'
9-
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')
9+
project(':capacitor-splash-screen').projectDir = new File('../node_modules/.bun/@capacitor+splash-screen@8.0.1+15e98482558ccfe6/node_modules/@capacitor/splash-screen/android')
1010

1111
include ':capgo-capacitor-native-biometric'
12-
project(':capgo-capacitor-native-biometric').projectDir = new File('../../android')
12+
project(':capgo-capacitor-native-biometric').projectDir = new File('../node_modules/.bun/@capgo+capacitor-native-biometric@file+../node_modules/@capgo/capacitor-native-biometric/android')
13+
14+
include ':capgo-capacitor-updater'
15+
project(':capgo-capacitor-updater').projectDir = new File('../node_modules/.bun/@capgo+capacitor-updater@8.47.10+15e98482558ccfe6/node_modules/@capgo/capacitor-updater/android')

example-app/capacitor.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const config: CapacitorConfig = {
88
webDir: 'dist',
99
plugins: {
1010
SplashScreen: {
11-
launchAutoHide: true,
11+
launchAutoHide: false,
1212
launchShowDuration: 1000,
1313
},
1414
CapgoNativeBiometric: {},
@@ -17,7 +17,6 @@ const config: CapacitorConfig = {
1717
autoUpdate: true,
1818
autoSplashscreen: true,
1919
directUpdate: 'always',
20-
defaultChannel: 'production',
2120
version: pkg.version,
2221
},
2322
},

example-app/ios/App/CapApp-SPM/Package.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ let package = Package(
1111
targets: ["CapApp-SPM"])
1212
],
1313
dependencies: [
14-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
15-
.package(name: "CapacitorCamera", path: "../../../node_modules/.bun/@capacitor+camera@7.0.2+15e98482558ccfe6/node_modules/@capacitor/camera"),
16-
.package(name: "CapacitorSplashScreen", path: "../../../node_modules/.bun/@capacitor+splash-screen@7.0.3+15e98482558ccfe6/node_modules/@capacitor/splash-screen"),
17-
.package(name: "CapgoCapacitorNativeBiometric", path: "../../../node_modules/.bun/@capgo+capacitor-native-biometric@file+../node_modules/@capgo/capacitor-native-biometric")
14+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.0.0"),
15+
.package(name: "CapacitorCamera", path: "../../../node_modules/.bun/@capacitor+camera@8.2.0+15e98482558ccfe6/node_modules/@capacitor/camera"),
16+
.package(name: "CapacitorSplashScreen", path: "../../../node_modules/.bun/@capacitor+splash-screen@8.0.1+15e98482558ccfe6/node_modules/@capacitor/splash-screen"),
17+
.package(name: "CapgoCapacitorNativeBiometric", path: "../../../node_modules/.bun/@capgo+capacitor-native-biometric@file+../node_modules/@capgo/capacitor-native-biometric"),
18+
.package(name: "CapgoCapacitorUpdater", path: "../../../node_modules/.bun/@capgo+capacitor-updater@8.47.10+15e98482558ccfe6/node_modules/@capgo/capacitor-updater")
1819
],
1920
targets: [
2021
.target(
@@ -24,7 +25,8 @@ let package = Package(
2425
.product(name: "Cordova", package: "capacitor-swift-pm"),
2526
.product(name: "CapacitorCamera", package: "CapacitorCamera"),
2627
.product(name: "CapacitorSplashScreen", package: "CapacitorSplashScreen"),
27-
.product(name: "CapgoCapacitorNativeBiometric", package: "CapgoCapacitorNativeBiometric")
28+
.product(name: "CapgoCapacitorNativeBiometric", package: "CapgoCapacitorNativeBiometric"),
29+
.product(name: "CapgoCapacitorUpdater", package: "CapgoCapacitorUpdater")
2830
]
2931
)
3032
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
4848
"clean": "rimraf ./dist",
4949
"watch": "tsc --watch",
50-
"prepublishOnly": "npm run build",
50+
"prepublishOnly": "bun run build",
5151
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
5252
"example:install": "cd example-app && bun install --frozen-lockfile",
5353
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",

scripts/deploy-example-capgo.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function readConfigString(key, fallback) {
3131

3232
function runCapgo(args, allowFailure = false) {
3333
const token = process.env.CAPGO_TOKEN;
34-
const fullArgs = ['@capgo/cli@8.0.2', ...args];
34+
const fullArgs = ['@capgo/cli@8.5.3', ...args];
3535
if (token) {
3636
fullArgs.push('--apikey', token);
3737
}
@@ -90,6 +90,12 @@ if (setStatus !== 0) {
9090
}
9191

9292
console.log(`Deploying ${appId} to Capgo channel "${channel}"`);
93+
const channelArgs = ['channel', 'add', channel, appId];
94+
if (channel === 'production') {
95+
channelArgs.push('--default');
96+
}
97+
runCapgo(channelArgs, true);
98+
9399

94100
runCapgo([
95101
'bundle',

0 commit comments

Comments
 (0)