create-disposabl-app 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
8
8
  import { Command, CommanderError } from "commander";
9
9
  import * as p2 from "@clack/prompts";
10
10
  // package.json
11
- var version = "0.6.5";
11
+ var version = "0.6.7";
12
12
 
13
13
  // ../disposabl-kit/platforms.ts
14
14
  var platforms = [
@@ -9,10 +9,19 @@ if [[ "$CHANNEL" == production ]]; then
9
9
  fi
10
10
  bun x --no-install expo prebuild --platform android --no-install
11
11
  test "$(bun x --no-install expo-updates runtimeversion:resolve --platform android --workflow managed | jq -er .runtimeVersion)" = "$RUNTIME"
12
- (cd android && ./gradlew :app:assembleRelease --no-daemon --build-cache)
13
- apk=android/app/build/outputs/apk/release/app-release.apk
14
- test "$(unzip -p "$apk" assets/fingerprint)" = "$RUNTIME"
12
+ task=assembleRelease
13
+ artifact=android.apk
14
+ binary=android/app/build/outputs/apk/release/app-release.apk
15
+ fingerprint=assets/fingerprint
16
+ if [[ "$CHANNEL" == production ]]; then
17
+ task=bundleRelease
18
+ artifact=android.aab
19
+ binary=android/app/build/outputs/bundle/release/app-release.aab
20
+ fingerprint=base/assets/fingerprint
21
+ fi
22
+ (cd android && ./gradlew ":app:$task" --no-daemon --build-cache)
23
+ test "$(unzip -p "$binary" "$fingerprint")" = "$RUNTIME"
15
24
  test "$(bun x --no-install expo-updates runtimeversion:resolve --platform android --workflow managed | jq -er .runtimeVersion)" = "$RUNTIME"
16
25
  mkdir -p ../../dist/release
17
- cp "$apk" ../../dist/release/android.apk
18
- jq --arg sha "$(sha256sum "$apk" | cut -d' ' -f1)" '. + {sha256: $sha, action: "build"}' <<< "$MANIFEST" > ../../dist/release/android.json
26
+ cp "$binary" "../../dist/release/$artifact"
27
+ jq --arg sha "$(sha256sum "$binary" | cut -d' ' -f1)" '. + {sha256: $sha, action: "build"}' <<< "$MANIFEST" > ../../dist/release/android.json
@@ -74,7 +74,7 @@ if (config.appId) {
74
74
  process.exit(0);
75
75
  }
76
76
  const suffix = {
77
- android: ".apk",
77
+ android: process.env.CHANNEL === "production" ? ".aab" : ".apk",
78
78
  ios: ".ipa",
79
79
  macos: ".dmg",
80
80
  windows: ".exe",
@@ -1,5 +1,25 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
+ if [[ -z "$EXPO_PROJECT_ID" ]]; then
4
+ # Initialize with static config; app.config.js reads the resulting environment.
5
+ mkdir -p "$RUNNER_TEMP/expo-project"
6
+ jq --slurpfile app ../../disposabl.json --arg owner "${EXPO_OWNER:-}" '
7
+ {expo: {name: .expo.name, slug: (if $app[0].appId then "app-" + $app[0].appId else .expo.slug end)}}
8
+ | if $owner != "" then .expo.owner = $owner else . end
9
+ ' app.json > "$RUNNER_TEMP/expo-project/app.json"
10
+ printf '{"name":"expo-project","private":true}\n' > "$RUNNER_TEMP/expo-project/package.json"
11
+ (
12
+ cd "$RUNNER_TEMP/expo-project"
13
+ set -- init --force --non-interactive --json --no-icon
14
+ [[ -z "${EXPO_OWNER:-}" ]] || set -- "$@" --account "$EXPO_OWNER"
15
+ bun x "$EAS_CLI" "$@"
16
+ ) > "$RUNNER_TEMP/expo-project.json"
17
+ EXPO_PROJECT_ID=$(jq -er .projectId "$RUNNER_TEMP/expo-project.json")
18
+ EXPO_OWNER=$(jq -er .owner "$RUNNER_TEMP/expo-project.json")
19
+ EXPO_SLUG=$(jq -er .slug "$RUNNER_TEMP/expo-project.json")
20
+ export EXPO_PROJECT_ID EXPO_OWNER EXPO_SLUG
21
+ printf 'EXPO_PROJECT_ID=%s\nEXPO_OWNER=%s\nEXPO_SLUG=%s\n' "$EXPO_PROJECT_ID" "$EXPO_OWNER" "$EXPO_SLUG" >> "$GITHUB_ENV"
22
+ fi
3
23
  jq --arg channel "$CHANNEL" '.build["ios-" + env.EAS_ENVIRONMENT].channel = $channel' eas.json > "$RUNNER_TEMP/eas.json"
4
24
  mv "$RUNNER_TEMP/eas.json" eas.json
5
25
  bun x "$EAS_CLI" env:pull --environment "$EAS_ENVIRONMENT" --path "$RUNNER_TEMP/expo.env" --non-interactive
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
+ artifact=android.apk
4
+ [[ "$CHANNEL" != production ]] || artifact=android.aab
5
+ export artifact
3
6
  for ((page=1; ; page++)); do
4
7
  gh api "repos/$GH_REPO/releases?per_page=100&page=$page" > "$RUNNER_TEMP/releases.json"
5
- jq --arg tag "$RELEASE_PREFIX-$CHANNEL-android" --arg legacy "$RELEASE_PREFIX-$CHANNEL" '[.[] | select(.draft | not) | select(.tag_name == $tag or .tag_name == $legacy or (.tag_name | startswith($legacy + "-"))) | select(any(.assets[]; .name == "android.apk"))] | sort_by(.tag_name != $tag, .tag_name != $legacy) | .[0] // {}' "$RUNNER_TEMP/releases.json" > "$RUNNER_TEMP/release.json"
8
+ jq --arg artifact "$artifact" --arg tag "$RELEASE_PREFIX-$CHANNEL-android" --arg legacy "$RELEASE_PREFIX-$CHANNEL" '[.[] | select(.draft | not) | select(.tag_name == $tag or .tag_name == $legacy or (.tag_name | startswith($legacy + "-"))) | select(any(.assets[]; .name == $artifact))] | sort_by(.tag_name != $tag, .tag_name != $legacy) | .[0] // {}' "$RUNNER_TEMP/releases.json" > "$RUNNER_TEMP/release.json"
6
9
  if jq -e '.id' "$RUNNER_TEMP/release.json" > /dev/null || [[ $(jq length "$RUNNER_TEMP/releases.json") -lt 100 ]]; then break; fi
7
10
  done
8
11
  bun x --no-install expo config --json > "$RUNNER_TEMP/mobile.json"
@@ -14,10 +17,10 @@ bun -e '
14
17
  const wanted = {channel: process.env.CHANNEL, projectId: config.extra.eas.projectId, applicationId: config.android.package, runtimeVersion: process.env.RUNTIME};
15
18
  const release = await Bun.file(`${process.env.RUNNER_TEMP}/release.json`).json();
16
19
  const prior = JSON.parse(/<!-- android (\{[^\n]+\}) -->/.exec(release.body || "")?.[1] || "null");
17
- const reusable = prior && Object.keys(wanted).every(k => prior[k] === wanted[k]) && /^[a-f0-9]{64}$/.test(prior.sha256 || "") && release.assets.some(a => a.name === "android.apk" && a.state === "uploaded" && a.size > 0 && a.digest === `sha256:${prior.sha256}`);
20
+ const reusable = prior && Object.keys(wanted).every(k => prior[k] === wanted[k]) && /^[a-f0-9]{64}$/.test(prior.sha256 || "") && release.assets.some(a => a.name === process.env.artifact && a.state === "uploaded" && a.size > 0 && a.digest === `sha256:${prior.sha256}`);
18
21
  const blocked = !reusable && process.env.CHANNEL === "production" && process.env.ANDROID_SIGNING_READY !== "true";
19
22
  if (blocked) {
20
- const reason = "Configure Android production signing credentials before building an APK.";
23
+ const reason = "Configure Android production signing credentials before building an AAB.";
21
24
  console.error(`::notice::${reason}`);
22
25
  const report = Bun.spawnSync(["node", ".github/scripts/disposabl.mjs", "report", "android", "blocked", reason], {
23
26
  cwd: process.env.GITHUB_WORKSPACE, stdout: "inherit", stderr: "inherit",
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
+ artifact=android.apk
4
+ [[ "$CHANNEL" != production ]] || artifact=android.aab
3
5
  mkdir -p dist/release
4
- gh release download "$TAG" --pattern android.apk --dir dist/release
5
- echo "$SHA dist/release/android.apk" | sha256sum --check
6
+ gh release download "$TAG" --pattern "$artifact" --dir dist/release
7
+ echo "$SHA dist/release/$artifact" | sha256sum --check
6
8
  cd apps/mobile
7
9
  bun x --no-install expo export --platform android --output-dir dist/update
8
10
  test "$(bun x --no-install expo-updates runtimeversion:resolve --platform android --workflow managed | jq -er .runtimeVersion)" = "$RUNTIME"
@@ -4,7 +4,7 @@ check_source() { test "$(gh api "repos/$GH_REPO/$SOURCE_PATH" --jq 'if has("head
4
4
  check_source
5
5
  for file in dist/release/*; do test -f "$file"; test -s "$file"; done
6
6
  case "$PLATFORM" in
7
- android) test -s dist/release/android.apk; test -s dist/release/android.json ;;
7
+ android) artifact=android.apk; [[ "$CHANNEL" != production ]] || artifact=android.aab; test -s "dist/release/$artifact"; test -s dist/release/android.json ;;
8
8
  ios) test -s dist/release/ios.ipa; test -s dist/release/ios.json ;;
9
9
  linux) compgen -G 'dist/release/*.deb' > /dev/null; compgen -G 'dist/release/*.rpm' > /dev/null ;;
10
10
  windows) compgen -G 'dist/release/*.exe' > /dev/null; compgen -G 'dist/release/*.nupkg' > /dev/null; test -s dist/release/RELEASES ;;
@@ -185,3 +185,5 @@ CI uses the project's EAS ad hoc credentials automatically. Missing or invalid
185
185
  credentials fail the iOS build instead of silently skipping it.
186
186
  It does not require TestFlight or an App Store Connect app record. TestFlight is
187
187
  a separate distribution option. The pipeline never submits to the App Store.
188
+
189
+ Android preview builds produce an installable APK. Production builds produce an AAB for Google Play. GitHub Actions builds and publishes these files; Expo hosts compatible EAS Updates.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",