@freeappstore/cli 0.4.97 → 0.4.98
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.
|
@@ -13,7 +13,7 @@ export declare const APP_ARCHETYPES: readonly AppArchetype[];
|
|
|
13
13
|
* The token is requested for the store API's audience; the API maps the
|
|
14
14
|
* verified repository_id to exactly one app and refuses anything else.
|
|
15
15
|
*/
|
|
16
|
-
export declare const KEYLESS_UPLOAD = "set -euo pipefail\ncd site\ntest -n \"$(ls -A .)\" || { echo \"::error::build artifact is empty\"; exit 1; }\nfind . -type f -printf '%P\\t%s\\n' \\\n | jq -Rn '[inputs | split(\"\\t\") | {key: .[0], value: (.[1] | tonumber)}] | from_entries' \\\n > \"$RUNNER_TEMP/sizes.json\"\n# Content hashes let the API skip files unchanged since the live release.\nfind . -type f -print0 | xargs -0 sha256sum \\\n | jq -Rn '[inputs | capture(\"^(?<h>[0-9a-f]{64}) \\\\./(?<p>.*)$\")] | map({key: .p, value: .h}) | from_entries' \\\n > \"$RUNNER_TEMP/hashes.json\"\njq -n --slurpfile f \"$RUNNER_TEMP/sizes.json\" --slurpfile h \"$RUNNER_TEMP/hashes.json\" \\\n '{files: $f[0], hashes: $h[0]}' > \"$RUNNER_TEMP/manifest.json\"\noidc=$(curl -fsS -H \"Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN\" \\\n \"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$DEPLOY_API\" | jq -r .value)\necho \"::add-mask::$oidc\"\nsession=$(curl -sS --fail-with-body -X POST \"$DEPLOY_API/v1/deploys\" \\\n -H \"Authorization: Bearer $oidc\" -H 'Content-Type: application/json' \\\n --data-binary @\"$RUNNER_TEMP/manifest.json\") \\\n || { echo \"::error::deploy refused: $session\"; exit 1; }\nprintf '%s' \"$session\" > \"$RUNNER_TEMP/session.json\"\nDEPLOY_TOKEN=$(jq -r .token \"$RUNNER_TEMP/session.json\")\necho \"::add-mask::$DEPLOY_TOKEN\"\nDEPLOY_URL=\"$DEPLOY_API/v1/deploys/$(jq -r .id \"$RUNNER_TEMP/session.json\")\"\nexport DEPLOY_TOKEN DEPLOY_URL\nupload() {\n curl -sS --fail-with-body --retry 3 --retry-all-errors -T \"./$1\" \\\n -H \"Authorization: Bearer $DEPLOY_TOKEN\" -H 'Content-Type: application/octet-stream' \\\n \"$DEPLOY_URL/files/$(jq -rn --arg p \"$1\" '$p | split(\"/\") | map(@uri) | join(\"/\")')\"\n}\nexport -f upload\nif jq -e 'has(\"missing\")' \"$RUNNER_TEMP/session.json\" > /dev/null; then\n # Delta: upload only what changed; the API copies the rest from the live release.\n echo \"Delta deploy: $(jq '.missing | length' \"$RUNNER_TEMP/session.json\") to upload, $(jq '.reuse | length' \"$RUNNER_TEMP/session.json\") reused from the live release\"\n jq -r '.missing[]' \"$RUNNER_TEMP/session.json\" | tr '\\n' '\\0' | xargs -0 -P 8 -n 1 bash -c 'upload \"$1\"' _\n reuse_batch() {\n curl -sS --fail-with-body --retry 3 --retry-all-errors -X POST \\\n -H \"Authorization: Bearer $DEPLOY_TOKEN\" -H 'Content-Type: application/json' \\\n --data-binary \"$1\" \"$DEPLOY_URL/reuse\" -w \"reuse batch: HTTP %{http_code} in %{time_total}s\\n\"\n }\n export -f reuse_batch\n jq -c '.reuse as $r | if ($r | length) == 0 then empty else ($r | _nwise(100) | {paths: .}) end' \\\n \"$RUNNER_TEMP/session.json\" | tr '\\n' '\\0' | xargs -0 -P
|
|
16
|
+
export declare const KEYLESS_UPLOAD = "set -euo pipefail\ncd site\ntest -n \"$(ls -A .)\" || { echo \"::error::build artifact is empty\"; exit 1; }\nfind . -type f -printf '%P\\t%s\\n' \\\n | jq -Rn '[inputs | split(\"\\t\") | {key: .[0], value: (.[1] | tonumber)}] | from_entries' \\\n > \"$RUNNER_TEMP/sizes.json\"\n# Content hashes let the API skip files unchanged since the live release.\nfind . -type f -print0 | xargs -0 sha256sum \\\n | jq -Rn '[inputs | capture(\"^(?<h>[0-9a-f]{64}) \\\\./(?<p>.*)$\")] | map({key: .p, value: .h}) | from_entries' \\\n > \"$RUNNER_TEMP/hashes.json\"\njq -n --slurpfile f \"$RUNNER_TEMP/sizes.json\" --slurpfile h \"$RUNNER_TEMP/hashes.json\" \\\n '{files: $f[0], hashes: $h[0]}' > \"$RUNNER_TEMP/manifest.json\"\noidc=$(curl -fsS -H \"Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN\" \\\n \"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$DEPLOY_API\" | jq -r .value)\necho \"::add-mask::$oidc\"\nsession=$(curl -sS --fail-with-body -X POST \"$DEPLOY_API/v1/deploys\" \\\n -H \"Authorization: Bearer $oidc\" -H 'Content-Type: application/json' \\\n --data-binary @\"$RUNNER_TEMP/manifest.json\") \\\n || { echo \"::error::deploy refused: $session\"; exit 1; }\nprintf '%s' \"$session\" > \"$RUNNER_TEMP/session.json\"\nDEPLOY_TOKEN=$(jq -r .token \"$RUNNER_TEMP/session.json\")\necho \"::add-mask::$DEPLOY_TOKEN\"\nDEPLOY_URL=\"$DEPLOY_API/v1/deploys/$(jq -r .id \"$RUNNER_TEMP/session.json\")\"\nexport DEPLOY_TOKEN DEPLOY_URL\nupload() {\n curl -sS --fail-with-body --retry 3 --retry-all-errors -T \"./$1\" \\\n -H \"Authorization: Bearer $DEPLOY_TOKEN\" -H 'Content-Type: application/octet-stream' \\\n \"$DEPLOY_URL/files/$(jq -rn --arg p \"$1\" '$p | split(\"/\") | map(@uri) | join(\"/\")')\"\n}\nexport -f upload\nif jq -e 'has(\"missing\")' \"$RUNNER_TEMP/session.json\" > /dev/null; then\n # Delta: upload only what changed; the API copies the rest from the live release.\n echo \"Delta deploy: $(jq '.missing | length' \"$RUNNER_TEMP/session.json\") to upload, $(jq '.reuse | length' \"$RUNNER_TEMP/session.json\") reused from the live release\"\n jq -r '.missing[]' \"$RUNNER_TEMP/session.json\" | tr '\\n' '\\0' | xargs -0 -P 8 -n 1 bash -c 'upload \"$1\"' _\n reuse_batch() {\n curl -sS --fail-with-body --retry 3 --retry-all-errors -X POST \\\n -H \"Authorization: Bearer $DEPLOY_TOKEN\" -H 'Content-Type: application/json' \\\n --data-binary \"$1\" \"$DEPLOY_URL/reuse\" -w \"reuse batch: HTTP %{http_code} in %{time_total}s\\n\"\n }\n export -f reuse_batch\n jq -c '.reuse as $r | if ($r | length) == 0 then empty else ($r | _nwise(100) | {paths: .}) end' \\\n \"$RUNNER_TEMP/session.json\" | tr '\\n' '\\0' | xargs -0 -P 8 -n 1 bash -c 'reuse_batch \"$1\"' _\nelse\n find . -type f -printf '%P\\0' | xargs -0 -P 8 -n 1 bash -c 'upload \"$1\"' _\nfi\ncurl -sS --fail-with-body -X POST -H \"Authorization: Bearer $DEPLOY_TOKEN\" \"$DEPLOY_URL/commit\"\necho\necho \"Deployed ${GITHUB_REPOSITORY##*/} from ${GITHUB_SHA::7}\"\n";
|
|
17
17
|
export declare function deployWorkflow(config: StoreConfig): string;
|
|
18
18
|
export declare function getArchetypeFiles(archetype: AppArchetype): Record<string, string>;
|
|
19
19
|
export declare function getTemplateFiles(config: StoreConfig, archetype?: AppArchetype, preset?: AppPreset): Record<string, string>;
|
|
@@ -914,7 +914,7 @@ if jq -e 'has("missing")' "$RUNNER_TEMP/session.json" > /dev/null; then
|
|
|
914
914
|
}
|
|
915
915
|
export -f reuse_batch
|
|
916
916
|
jq -c '.reuse as $r | if ($r | length) == 0 then empty else ($r | _nwise(100) | {paths: .}) end' \\
|
|
917
|
-
"$RUNNER_TEMP/session.json" | tr '\\n' '\\0' | xargs -0 -P
|
|
917
|
+
"$RUNNER_TEMP/session.json" | tr '\\n' '\\0' | xargs -0 -P 8 -n 1 bash -c 'reuse_batch "$1"' _
|
|
918
918
|
else
|
|
919
919
|
find . -type f -printf '%P\\0' | xargs -0 -P 8 -n 1 bash -c 'upload "$1"' _
|
|
920
920
|
fi
|