mirror of
https://github.com/expo/expo-github-action.git
synced 2026-11-15 17:32:45 -10:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5273c2136b | ||
|
|
f2443cd442 | ||
|
|
9da89d3617 | ||
|
|
a01802364d | ||
|
|
c33d336e43 | ||
|
|
6cb800515a | ||
|
|
eab7a23020 | ||
|
|
94ad6f36fb |
No files matched your search
@@ -8,7 +8,7 @@ inputs:
|
||||
|
||||
node-version:
|
||||
description: Version of Node to use
|
||||
default: 20.x
|
||||
default: 24.x
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
+117
-48
@@ -6,17 +6,22 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: 'type "release" to create the release (main branch only)'
|
||||
description: 'type "release" to open a release PR (main branch only)'
|
||||
required: false
|
||||
|
||||
concurrency:
|
||||
group: release
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
dryrun:
|
||||
if: ${{ github.ref != 'refs/heads/main' || github.event.inputs.release != 'release' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# semantic-release checks push access even in dry-run mode
|
||||
contents: write
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -25,75 +30,139 @@ jobs:
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: bun install
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: 📋 Dry-running release
|
||||
run: bun semantic-release --dry-run
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
publish:
|
||||
release-pr:
|
||||
if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.release == 'release' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.EXPOBOT_GITHUB_TOKEN }}
|
||||
# Keep the token out of .git/config while installing packages
|
||||
persist-credentials: false
|
||||
|
||||
- name: 🏗 Setup runner
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: bun install
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: 📋 Release code
|
||||
run: bun semantic-release
|
||||
- name: 📋 Resolve next release
|
||||
run: bun semantic-release --dry-run
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.EXPOBOT_GITHUB_TOKEN }}
|
||||
GIT_AUTHOR_NAME: Expo CI
|
||||
GIT_AUTHOR_EMAIL: [email protected]
|
||||
GIT_COMMITTER_NAME: Expo CI
|
||||
GIT_COMMITTER_EMAIL: [email protected]
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
RELEASE_OUTPUT_DIR: ${{ runner.temp }}/release
|
||||
|
||||
tags:
|
||||
needs: publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.EXPOBOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: 🏗 Setup runner
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
- name: 👷 Force repo to latest
|
||||
run: git fetch --all && git pull
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: 📦 Install semver
|
||||
run: bun add --dev semver
|
||||
|
||||
- name: 🕵️ Resolve major version
|
||||
uses: actions/github-script@v7
|
||||
id: version
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const semver = require('semver')
|
||||
const { version } = require('./package.json')
|
||||
return semver.major(version)
|
||||
|
||||
- name: 👷 Configure git
|
||||
- name: 📝 Push release branch
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
RELEASE_DIR: ${{ runner.temp }}/release
|
||||
run: |
|
||||
if [ ! -f "$RELEASE_DIR/version" ]; then
|
||||
echo "No changes to release"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
version=$(cat "$RELEASE_DIR/version")
|
||||
branch="release/$version"
|
||||
title="chore: create new release $version"
|
||||
|
||||
npm pkg set version="$version"
|
||||
{ cat "$RELEASE_DIR/notes.md"; echo; cat CHANGELOG.md; } > CHANGELOG.md.tmp
|
||||
mv CHANGELOG.md.tmp CHANGELOG.md
|
||||
|
||||
git config user.name "Expo CI"
|
||||
git config user.email "[email protected]"
|
||||
git switch --create "$branch"
|
||||
git commit --message "$title" -- package.json CHANGELOG.md
|
||||
# Lets git read GH_TOKEN through gh, so the token stays out of the command line
|
||||
gh auth setup-git
|
||||
git push --force origin "$branch"
|
||||
|
||||
- name: 🧹 Clean repo
|
||||
run: git clean . -xdf && git reset --hard HEAD && git pull && git fetch --tags
|
||||
# A person opens the PR, so Actions doesn't need permission to create or approve PRs, and CI runs on it
|
||||
url="https://github.com/${GITHUB_REPOSITORY}/compare/main...${branch}?expand=1&title=$(jq -rn --arg t "$title" '$t|@uri')"
|
||||
echo "::notice::Open the release PR: $url"
|
||||
{
|
||||
echo "## Release $version"
|
||||
echo
|
||||
echo "[Open the release PR]($url)"
|
||||
echo
|
||||
cat "$RELEASE_DIR/notes.md"
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
- name: 📋 Update tags
|
||||
run: git tag --force v${{ steps.version.outputs.result }} && git push --force --tags
|
||||
publish:
|
||||
# Runs when a release PR from `release-pr` is merged
|
||||
if: "${{ github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore: create new release ') }}"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🕵️ Validate release PR
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
version=$(node -p "require('./package.json').version")
|
||||
fail() {
|
||||
echo "::error::$1. Revert this commit and run the release workflow again."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# GitHub may take a moment to link a new commit to its PR
|
||||
for attempt in 1 2 3 4 5; do
|
||||
pr=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls" --jq '[.[] | select(.base.ref == "main" and .merged_at != null)][0]')
|
||||
[ -n "$pr" ] && [ "$pr" != "null" ] && break
|
||||
sleep 10
|
||||
done
|
||||
if [ -z "$pr" ] || [ "$pr" = "null" ]; then
|
||||
echo "::error::No merged PR found for this commit yet. Re-run this job."
|
||||
exit 1
|
||||
fi
|
||||
[ "$(jq -r .head.ref <<< "$pr")" = "release/$version" ] || fail "The PR is not from release/$version"
|
||||
|
||||
commits=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$(jq -r .number <<< "$pr")/commits")
|
||||
[ "$(jq length <<< "$commits")" -eq 1 ] || fail "The release PR must have exactly one commit"
|
||||
|
||||
# Other merges since the release branch was created would ship without changelog entries
|
||||
release_base=$(jq -r '.[0].parents[0].sha' <<< "$commits")
|
||||
merge_parent=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA" --jq '.parents[0].sha')
|
||||
[ "$release_base" = "$merge_parent" ] || fail "main changed after the release branch was created"
|
||||
|
||||
- name: 📋 Create release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
run: |
|
||||
version=$(node -p "require('./package.json').version")
|
||||
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "::error::Invalid version \"$version\" in package.json"
|
||||
exit 1
|
||||
fi
|
||||
# Squash merges add " (#123)" to the title
|
||||
subject="${COMMIT_MESSAGE%%$'\n'*}"
|
||||
if [[ "$subject" != "chore: create new release $version" && "$subject" != "chore: create new release $version (#"* ]]; then
|
||||
echo "::error::Commit message does not match version $version in package.json"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The newest section of CHANGELOG.md holds the notes for this release
|
||||
awk '/^## \[/ { n++ } n == 1' CHANGELOG.md > "$RUNNER_TEMP/notes.md"
|
||||
# Skip when a re-run finds the release already made, so the major tag can still move
|
||||
if ! gh release view "$version" > /dev/null 2>&1; then
|
||||
gh release create "$version" --target "$GITHUB_SHA" --title "$version" --notes-file "$RUNNER_TEMP/notes.md"
|
||||
fi
|
||||
|
||||
major="v${version%%.*}"
|
||||
git tag --force "$major" "$GITHUB_SHA"
|
||||
git push --force origin "$major"
|
||||
+16
-8
@@ -1,3 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const rules = [
|
||||
{ type: 'feat', release: 'minor', title: 'New features' },
|
||||
{ type: 'feature', release: 'minor', title: 'New features' },
|
||||
@@ -32,13 +35,18 @@ module.exports = {
|
||||
commitGroupsSort: (a, z) => sortMap[a.title] - sortMap[z.title],
|
||||
},
|
||||
}],
|
||||
'@semantic-release/changelog',
|
||||
['@semantic-release/npm', { npmPublish: false }],
|
||||
["@semantic-release/exec", { publishCmd: 'yarn build' }],
|
||||
['@semantic-release/git', {
|
||||
message: 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}',
|
||||
assets: ['package.json', 'CHANGELOG.md', 'build/*'],
|
||||
}],
|
||||
'@semantic-release/github',
|
||||
// The release workflow runs a dry run and uses this output to make the release branch.
|
||||
// Must stay after the notes generator, so `nextRelease.notes` is filled in.
|
||||
{
|
||||
generateNotes(pluginConfig, { nextRelease }) {
|
||||
const outputDir = process.env.RELEASE_OUTPUT_DIR;
|
||||
if (outputDir) {
|
||||
fs.mkdirSync(outputDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(outputDir, 'version'), nextRelease.version);
|
||||
fs.writeFileSync(path.join(outputDir, 'notes.md'), nextRelease.notes.trim() + '\n');
|
||||
}
|
||||
return '';
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,3 +1,48 @@
|
||||
## [9.0.2](https://github.com/expo/expo-github-action/compare/9.0.1...9.0.2) (2026-11-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* **preview:** Honor native scheme overrides in development build QR codes ([#365](https://github.com/expo/expo-github-action/issues/365)) ([f2443cd](https://github.com/expo/expo-github-action/commit/f2443cd44215902958beadca9aa808395ff56eba))
|
||||
|
||||
## [9.0.1](https://github.com/expo/expo-github-action/compare/9.0.0...9.0.1) (2026-10-20)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* support eas-cli 22 build json fields ([#360](https://github.com/expo/expo-github-action/issues/360)) ([6cb8005](https://github.com/expo/expo-github-action/commit/6cb800515acdea84989f9918e6448774815d8a78))
|
||||
|
||||
### Other chores
|
||||
|
||||
* release through a PR because main is protected ([#363](https://github.com/expo/expo-github-action/issues/363)) ([a018023](https://github.com/expo/expo-github-action/commit/a01802364dfe057a6f67a5cb1892b6f529e2d624))
|
||||
* release with the built-in GitHub token ([#362](https://github.com/expo/expo-github-action/issues/362)) ([c33d336](https://github.com/expo/expo-github-action/commit/c33d336e43640e810176b257b3919c7d408afc7e))
|
||||
|
||||
## [9.0.0](https://github.com/expo/expo-github-action/compare/8.2.1...9.0.0) (2026-06-02)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* update tooling and actions to Node 24 (#354)
|
||||
|
||||
### New features
|
||||
|
||||
* **continuous-deploy-fingerprint:** Add optional environment input for EAS updates ([#325](https://github.com/expo/expo-github-action/issues/325)) ([8134c7a](https://github.com/expo/expo-github-action/commit/8134c7a005e20406f4bdf78ecc1679c373b32a3f))
|
||||
* **continuous-deploy-fingerprint:** added platform arg to eas update command ([#319](https://github.com/expo/expo-github-action/issues/319)) ([332258e](https://github.com/expo/expo-github-action/commit/332258e32f36861feca287bc8f7021383da59d20))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* **continuous-deploy-fingerprint:** correct expiration date logic for build validation ([#307](https://github.com/expo/expo-github-action/issues/307)) ([4b7860b](https://github.com/expo/expo-github-action/commit/4b7860b64d4f0519c52f9c9d51c20f6b73490552))
|
||||
* fingerprint hash parsing ([#326](https://github.com/expo/expo-github-action/issues/326)) ([10bd583](https://github.com/expo/expo-github-action/commit/10bd583de69c62e4a2f5203e3844314e6ea56d51))
|
||||
* one more merge confict fix ([#327](https://github.com/expo/expo-github-action/issues/327)) ([24136f8](https://github.com/expo/expo-github-action/commit/24136f8a82a7ce49225511185be02a7a9e30bb51))
|
||||
|
||||
### Other chores
|
||||
|
||||
* commit built files from [#319](https://github.com/expo/expo-github-action/issues/319) ([#323](https://github.com/expo/expo-github-action/issues/323)) ([a88f4a0](https://github.com/expo/expo-github-action/commit/a88f4a07b2b56b12af23d729bf18b2a9bab21eba))
|
||||
* update readme to better clarify production continuous deployment caveats ([#328](https://github.com/expo/expo-github-action/issues/328)) ([d933805](https://github.com/expo/expo-github-action/commit/d933805e9c7e860b0c7324ea5b8dcca94d415f8e))
|
||||
* update tooling and actions to Node 24 ([#354](https://github.com/expo/expo-github-action/issues/354)) ([94ad6f3](https://github.com/expo/expo-github-action/commit/94ad6f36fbc63d652f26fa4edbfc6acacf4f574f))
|
||||
|
||||
### Documentation changes
|
||||
|
||||
* missing action inputs added to readme ([#275](https://github.com/expo/expo-github-action/issues/275)) ([047ecf1](https://github.com/expo/expo-github-action/commit/047ecf1b39d35e205633972e83470dc3d9be3471))
|
||||
* **preview:** fix typo in readme ([f6f3acf](https://github.com/expo/expo-github-action/commit/f6f3acfa2728044b4e7e2592fe99c12796336e61))
|
||||
|
||||
## [8.2.1](https://github.com/expo/expo-github-action/compare/8.2.0...8.2.1) (2024-01-15)
|
||||
|
||||
|
||||
|
||||
+7
-3
@@ -46,15 +46,19 @@ To get your PR merged as fast as possible, please make sure you have done the fo
|
||||
|
||||
## 🚀 Releasing a new version
|
||||
|
||||
To release a new version for GitHub Actions, we have to create a new release in GitHub. You can run the `Release` workflow to generate a new version, changelog, and GitHub release.
|
||||
To release a new version for GitHub Actions, we have to create a new release in GitHub through a release PR.
|
||||
|
||||
That workflow also bumps up the major version tag, like `v7`. In cases of failure, you could run this manually.
|
||||
1. Run the `Release` workflow on `main` and type `release`. It pushes a `release/x.y.z` branch that bumps `package.json` and `CHANGELOG.md`.
|
||||
2. Open the PR from the link in the workflow summary, then review and merge it. Keep the `chore: create new release x.y.z` title, because the workflow uses it to find release merges. Merge it before any other PR. If `main` changed in between, the release fails, and you need to revert the release PR and start again.
|
||||
3. After the merge, the workflow creates the `x.y.z` tag and GitHub release, and moves the major version tag, like `v7`.
|
||||
|
||||
In cases of failure, you could move the major version tag manually.
|
||||
|
||||
```bash
|
||||
$ git checkout main
|
||||
$ git fetch --tags && git pull
|
||||
$ git tag --force v{major}
|
||||
$ git push --force --tags
|
||||
$ git push --force origin v{major}
|
||||
```
|
||||
|
||||
When the release is fully tagged and ready, we still need to submit it to the marketplace. You can do that by editing the published version on [GitHub's release page](https://github.com/expo/expo-github-action/releases). Just saving it again notifies the marketplace of the new version.
|
||||
+1
-1
@@ -6,7 +6,7 @@ branding:
|
||||
icon: terminal
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: build/setup/index.js
|
||||
inputs:
|
||||
expo-version:
|
||||
|
||||
Generated
+19
-5
@@ -32328,6 +32328,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -32363,6 +32364,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -32445,7 +32459,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -32470,7 +32484,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -32492,7 +32506,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -32500,12 +32514,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
|
||||
+21
-6
@@ -27932,6 +27932,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -27967,6 +27968,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -28049,7 +28063,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -28074,7 +28088,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -28096,7 +28110,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -28104,12 +28118,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
@@ -28274,7 +28288,8 @@ async function getBuildInfoWithFingerprintAsync({ cwd, platform, profile, finger
|
||||
cwd,
|
||||
silent: !(0, core_1.isDebug)(),
|
||||
});
|
||||
builds = JSON.parse(stdout);
|
||||
const parsed = JSON.parse(stdout);
|
||||
builds = Array.isArray(parsed) ? parsed.map(expo_1.normalizeBuildInfo) : parsed;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Error getting EAS builds: ${String(error)}`, { cause: error });
|
||||
|
||||
+37
-9
@@ -34859,7 +34859,16 @@ async function createUpdate(cwd, command) {
|
||||
/**
|
||||
* Create a QR code link for an EAS Update.
|
||||
*/
|
||||
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, qrTarget, }) {
|
||||
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, appScheme, qrTarget, }) {
|
||||
if (qrTarget === 'dev-build' && appScheme) {
|
||||
// /eas-update treats appScheme as a slug and prefixes it with exp+.
|
||||
// /development-client uses the native scheme verbatim instead.
|
||||
const url = new url_1.URL('https://qr.expo.dev/development-client');
|
||||
const host = process.env.EXPO_STAGING ? 'staging-u.expo.dev' : 'u.expo.dev';
|
||||
url.searchParams.append('appScheme', appScheme);
|
||||
url.searchParams.append('url', `https://${host}/${projectId}/group/${updateGroupId}`);
|
||||
return url.toString();
|
||||
}
|
||||
const url = new url_1.URL('https://qr.expo.dev/eas-update');
|
||||
if (qrTarget === 'dev-build') {
|
||||
// While the parameter is called `appScheme`, it's actually the app's slug
|
||||
@@ -34893,6 +34902,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -34928,6 +34938,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -35010,7 +35033,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -35035,7 +35058,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -35057,7 +35080,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -35065,12 +35088,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
@@ -35235,7 +35258,8 @@ async function getBuildInfoWithFingerprintAsync({ cwd, platform, profile, finger
|
||||
cwd,
|
||||
silent: !(0, core_1.isDebug)(),
|
||||
});
|
||||
builds = JSON.parse(stdout);
|
||||
const parsed = JSON.parse(stdout);
|
||||
builds = Array.isArray(parsed) ? parsed.map(expo_1.normalizeBuildInfo) : parsed;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Error getting EAS builds: ${String(error)}`, { cause: error });
|
||||
@@ -37540,6 +37564,7 @@ function collectContinuousDeployFingerprintInput() {
|
||||
branch: (0, input_1.getInput)('branch', { required: true }),
|
||||
platform: platformInput,
|
||||
environment: (0, input_1.getInput)('environment'),
|
||||
appScheme: (0, input_1.getInput)('app-scheme') || undefined,
|
||||
autoSubmitBuilds: (0, input_1.getInput)('auto-submit-builds') === 'true',
|
||||
githubToken: (0, input_1.getInput)('github-token', { required: true }),
|
||||
workingDirectory: (0, input_1.getInput)('working-directory', { required: true }),
|
||||
@@ -37699,7 +37724,8 @@ async function publishEASUpdatesAsync({ cwd, branch, environment, platform, }) {
|
||||
function createSummaryForUpdatesAndBuilds({ config, projectId, updates, buildRunInfos, options, }) {
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = (0, comment_1.getQrTarget)(options);
|
||||
const appSchemes = (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
|
||||
const appScheme = options.appScheme;
|
||||
const appSchemes = appScheme ? [appScheme] : (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
|
||||
const { androidBuildRunInfo, iosBuildRunInfo } = buildRunInfos;
|
||||
const androidUpdate = updates.find(update => update.platform === 'android');
|
||||
const iosUpdate = updates.find(update => update.platform === 'ios');
|
||||
@@ -37707,7 +37733,9 @@ function createSummaryForUpdatesAndBuilds({ config, projectId, updates, buildRun
|
||||
const getUpdateLink = (update) => update
|
||||
? `[Update Permalink](${(0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: update.group })})`
|
||||
: 'n/a';
|
||||
const getUpdateQRURL = (update) => update ? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: update.group, appSlug, qrTarget }) : null;
|
||||
const getUpdateQRURL = (update) => update
|
||||
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: update.group, appSlug, appScheme, qrTarget })
|
||||
: null;
|
||||
const getBuildDetails = (buildRunInfo) => getBuildLink(buildRunInfo.buildInfo) +
|
||||
'<br />' +
|
||||
(0, comment_1.createDetails)({
|
||||
|
||||
Generated
+19
-5
@@ -98364,6 +98364,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -98399,6 +98400,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -98481,7 +98495,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -98506,7 +98520,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -98528,7 +98542,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -98536,12 +98550,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
|
||||
Generated
+19
-5
@@ -32272,6 +32272,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -32307,6 +32308,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -32389,7 +32403,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -32414,7 +32428,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -32436,7 +32450,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -32444,12 +32458,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
|
||||
Generated
+45
-12
@@ -34780,6 +34780,7 @@ function previewInput() {
|
||||
}
|
||||
return {
|
||||
command: (0, core_1.getInput)('command'),
|
||||
appScheme: (0, core_1.getInput)('app-scheme') || undefined,
|
||||
shouldComment: !(0, core_1.getInput)('comment') || (0, core_1.getBooleanInput)('comment'),
|
||||
commentId: (0, core_1.getInput)('comment-id') || exports.MESSAGE_ID,
|
||||
workingDirectory: (0, core_1.getInput)('working-directory'),
|
||||
@@ -34857,7 +34858,8 @@ function getVariables(config, updates, options) {
|
||||
const projectId = config.extra?.eas?.projectId;
|
||||
const android = updates.find(update => update.platform === 'android');
|
||||
const ios = updates.find(update => update.platform === 'ios');
|
||||
const appSchemes = (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
|
||||
const appScheme = options.appScheme;
|
||||
const appSchemes = appScheme ? [appScheme] : (0, comment_1.getSchemesInOrderFromConfig)(config) || [];
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = (0, comment_1.getQrTarget)(options);
|
||||
return {
|
||||
@@ -34865,13 +34867,19 @@ function getVariables(config, updates, options) {
|
||||
projectId,
|
||||
projectName: config.name,
|
||||
projectSlug: appSlug,
|
||||
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
|
||||
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
|
||||
projectScheme: appSchemes[0] || '', // The override, or the longest configured app scheme
|
||||
projectSchemes: JSON.stringify(appSchemes), // The override, or configured app schemes in priority order as JSON
|
||||
// Shared update properties
|
||||
// Note, only use these properties when the update groups are identical
|
||||
groupId: updates[0].group,
|
||||
runtimeVersion: updates[0].runtimeVersion,
|
||||
qr: (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
|
||||
qr: (0, eas_1.getUpdateGroupQr)({
|
||||
projectId,
|
||||
updateGroupId: updates[0].group,
|
||||
appSlug,
|
||||
appScheme,
|
||||
qrTarget,
|
||||
}),
|
||||
link: (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: updates[0].group }),
|
||||
// These are safe to access regardless of the update groups
|
||||
branchName: updates[0].branch,
|
||||
@@ -34886,7 +34894,7 @@ function getVariables(config, updates, options) {
|
||||
androidMessage: android?.message || '',
|
||||
androidRuntimeVersion: android?.runtimeVersion || '',
|
||||
androidQR: android
|
||||
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: android.group, appSlug, qrTarget })
|
||||
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: android.group, appSlug, appScheme, qrTarget })
|
||||
: '',
|
||||
androidLink: android ? (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: android.group }) : '',
|
||||
// iOS update
|
||||
@@ -34896,7 +34904,9 @@ function getVariables(config, updates, options) {
|
||||
iosManifestPermalink: ios?.manifestPermalink || '',
|
||||
iosMessage: ios?.message || '',
|
||||
iosRuntimeVersion: ios?.runtimeVersion || '',
|
||||
iosQR: ios ? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
|
||||
iosQR: ios
|
||||
? (0, eas_1.getUpdateGroupQr)({ projectId, updateGroupId: ios.group, appSlug, appScheme, qrTarget })
|
||||
: '',
|
||||
iosLink: ios ? (0, eas_1.getUpdateGroupWebsite)({ projectId, updateGroupId: ios.group }) : '',
|
||||
};
|
||||
}
|
||||
@@ -35071,7 +35081,16 @@ async function createUpdate(cwd, command) {
|
||||
/**
|
||||
* Create a QR code link for an EAS Update.
|
||||
*/
|
||||
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, qrTarget, }) {
|
||||
function getUpdateGroupQr({ projectId, updateGroupId, appSlug, appScheme, qrTarget, }) {
|
||||
if (qrTarget === 'dev-build' && appScheme) {
|
||||
// /eas-update treats appScheme as a slug and prefixes it with exp+.
|
||||
// /development-client uses the native scheme verbatim instead.
|
||||
const url = new url_1.URL('https://qr.expo.dev/development-client');
|
||||
const host = process.env.EXPO_STAGING ? 'staging-u.expo.dev' : 'u.expo.dev';
|
||||
url.searchParams.append('appScheme', appScheme);
|
||||
url.searchParams.append('url', `https://${host}/${projectId}/group/${updateGroupId}`);
|
||||
return url.toString();
|
||||
}
|
||||
const url = new url_1.URL('https://qr.expo.dev/eas-update');
|
||||
if (qrTarget === 'dev-build') {
|
||||
// While the parameter is called `appScheme`, it's actually the app's slug
|
||||
@@ -35105,6 +35124,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -35140,6 +35160,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -35222,7 +35255,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -35247,7 +35280,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -35269,7 +35302,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -35277,12 +35310,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
|
||||
Generated
+19
-5
@@ -97986,6 +97986,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.appPlatformEmojis = exports.appPlatformDisplayNames = exports.BuildStatus = exports.AppPlatform = void 0;
|
||||
exports.normalizeBuildInfo = normalizeBuildInfo;
|
||||
exports.parseCommand = parseCommand;
|
||||
exports.authenticate = authenticate;
|
||||
exports.projectOwner = projectOwner;
|
||||
@@ -98021,6 +98022,19 @@ var BuildStatus;
|
||||
BuildStatus["Finished"] = "FINISHED";
|
||||
BuildStatus["Canceled"] = "CANCELED";
|
||||
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
function normalizeBuildInfo(build) {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app),
|
||||
channel: (build.channel ?? updateChannel?.name),
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
exports.appPlatformDisplayNames = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -98103,7 +98117,7 @@ async function easBuild(cmd) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Create an new EAS build using the user-provided command.
|
||||
@@ -98128,7 +98142,7 @@ async function createEasBuildFromRawCommandAsync(cwd, command, extraArgs = []) {
|
||||
catch (error) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
return JSON.parse(stdout);
|
||||
return JSON.parse(stdout).map(normalizeBuildInfo);
|
||||
}
|
||||
/**
|
||||
* Cancel an EAS build.
|
||||
@@ -98150,7 +98164,7 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
cwd,
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
}
|
||||
catch (error) {
|
||||
(0, core_1.info)(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
@@ -98158,12 +98172,12 @@ async function queryEasBuildInfoAsync(cwd, buildId) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
async function projectInfo(dir) {
|
||||
let stdout = '';
|
||||
try {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)(await (0, io_1.which)('expo', true), ['config', '--json', '--type', 'prebuild'], {
|
||||
({ stdout } = await (0, exec_1.getExecOutput)('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ branding:
|
||||
icon: message-circle
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/command/index.js
|
||||
inputs:
|
||||
github-token:
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/continuous-deploy-fingerprint-info/index.js
|
||||
inputs:
|
||||
profile:
|
||||
|
||||
@@ -65,8 +65,11 @@ Here is a summary of all the input options you can use.
|
||||
| **working-directory** | - | The relative directory of your Expo app |
|
||||
| **platform** | `all` | The platform to deploy on (available options are `ios`, `android` and `all`) |
|
||||
| **auto-submit-builds** | - | Whether to add the `--auto-submit` flag to the issued `eas build` commands. |
|
||||
| **app-scheme** | - | Override the native scheme shown in the comment and used for development-build QR codes. Omit it to use `exp+<slug>` for QR codes. Does not affect Expo Go QR codes. |
|
||||
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
|
||||
For development clients that do not register the generated `exp+<slug>` scheme (for example, bare projects or clients built with `addGeneratedScheme: false`), set `app-scheme` to the exact scheme registered by that client. This value is independent of the config evaluated on the runner, so it can target a development variant even when `eas update --environment ...` uses different environment variables.
|
||||
|
||||
And the action will generate these [outputs](#available-outputs) for other actions to do something based on what this action did.
|
||||
|
||||
### Available outputs
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/continuous-deploy-fingerprint/index.js
|
||||
inputs:
|
||||
profile:
|
||||
@@ -18,6 +18,9 @@ inputs:
|
||||
environment:
|
||||
description: The environment to use for server-side defined EAS environment variables during command execution
|
||||
required: false
|
||||
app-scheme:
|
||||
description: Override the app scheme shown in the comment and used for development-build QR codes. Defaults to the generated exp+<slug> scheme for QR codes. Does not affect Expo Go QR codes.
|
||||
required: false
|
||||
platform:
|
||||
description: The platform on which to publish. Possible values are 'all' | 'android' | 'ios'
|
||||
required: false
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/fingerprint/index.js
|
||||
post: ../build/fingerprint-post/index.js
|
||||
post-if: success()
|
||||
|
||||
+5
-8
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "expo-github-action",
|
||||
"version": "8.2.1",
|
||||
"version": "9.0.2",
|
||||
"description": "Expo CLI in your GitHub Actions workflow",
|
||||
"main": "build/index.js",
|
||||
"repository": {
|
||||
@@ -34,18 +34,15 @@
|
||||
"@expo/config": "^10.0.9",
|
||||
"@expo/fingerprint": "^0.11.9",
|
||||
"@expo/spawn-async": "^1.7.2",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@semantic-release/exec": "^7.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@tsconfig/node20": "^20.1.4",
|
||||
"@tsconfig/node24": "^24.0.4",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.13.4",
|
||||
"@types/node": "^24.12.3",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"conventional-changelog-conventionalcommits": "^8.0.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-universe": "^14.0.0",
|
||||
"eslint-config-universe": "^15.2.0",
|
||||
"getenv": "^1.0.0",
|
||||
"jest": "^29.3.1",
|
||||
"jest-snapshot-prettier": "npm:prettier@^2.8.8",
|
||||
@@ -53,7 +50,7 @@
|
||||
"semantic-release": "^24.2.2",
|
||||
"sqlite3": "^5.1.6",
|
||||
"ts-jest": "^29.2.5",
|
||||
"typescript": "^5.7.3"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"sqlite3"
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/preview-build/index.js
|
||||
inputs:
|
||||
command:
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: message-circle
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/preview-comment/index.js
|
||||
inputs:
|
||||
project:
|
||||
|
||||
+5
-2
@@ -49,8 +49,11 @@ Here is a summary of all the input options you can use.
|
||||
| **comment** | `true` | If the action should summarize the EAS Update information as comment on a pull request |
|
||||
| **comment-id** | _[see code][code-defaults]_ | Unique id template to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
|
||||
| **qr-target** | _inferred from project_ | Either `dev-build` or `expo-go`, affects how the EAS Update is opened through the QR code. <br /> Defaults to `dev-build` when `expo-dev-client` is detected within the project. |
|
||||
| **app-scheme** | - | Override the native scheme shown in the comment and used for development-build QR codes. Omit it to use `exp+<slug>` for QR codes. Does not affect Expo Go QR codes. |
|
||||
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
|
||||
For development clients that do not register the generated `exp+<slug>` scheme (for example, bare projects or clients built with `addGeneratedScheme: false`), set `app-scheme` to the exact scheme registered by that client. This value is independent of the config evaluated on the runner, so it can target a development variant even when `eas update --environment ...` uses different environment variables.
|
||||
|
||||
## Available outputs
|
||||
|
||||
There are a few variables available that you can use to set up your own notifications.
|
||||
@@ -61,8 +64,8 @@ These variables are strings; some may be empty because of your project configura
|
||||
| **projectId** | The resolved EAS project ID |
|
||||
| **projectName** | The name of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#name)) |
|
||||
| **projectSlug** | The slug of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#slug)) |
|
||||
| **projectScheme** | The longest (custom) app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **projectSchemes** | All (custom) app schemes in order of longest to shortest, as JSON string ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **projectScheme** | The `app-scheme` override, or longest configured app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **projectSchemes** | The `app-scheme` override, or configured app schemes in order of longest to shortest, as a JSON string ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **commentId** | The unique comment ID to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
|
||||
| **comment** | The comment with information about the updates |
|
||||
|
||||
|
||||
+3
-5
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
using: node24
|
||||
main: ../build/preview/index.js
|
||||
inputs:
|
||||
command:
|
||||
@@ -29,10 +29,8 @@ inputs:
|
||||
description: GitHub token to use when commenting on PR
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
# Below are deprecated and won't be supported anymore
|
||||
app-scheme:
|
||||
deprecated: true
|
||||
description: The (custom) app scheme to use when creating the preview QR code
|
||||
description: Override the app scheme shown in the comment and used for development-build QR codes. Defaults to the generated exp+<slug> scheme for QR codes. Does not affect Expo Go QR codes.
|
||||
required: false
|
||||
outputs:
|
||||
projectId:
|
||||
@@ -42,7 +40,7 @@ outputs:
|
||||
projectSlug:
|
||||
description: The slug of your project
|
||||
projectScheme:
|
||||
description: The (custom) app scheme
|
||||
description: The app-scheme override, or the longest configured app scheme
|
||||
|
||||
commentId:
|
||||
description: The unique comment ID to prevent duplicate comments
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { collectContinuousDeployFingerprintInput } from '../../actions/continuous-deploy-fingerprint';
|
||||
|
||||
jest.mock('../../worker');
|
||||
|
||||
describe(collectContinuousDeployFingerprintInput, () => {
|
||||
it.each([
|
||||
{ value: '', expected: undefined },
|
||||
{ value: 'myapp-dev', expected: 'myapp-dev' },
|
||||
])('reads the native scheme override "$value"', ({ value, expected }) => {
|
||||
const previous = process.env;
|
||||
process.env = {
|
||||
...previous,
|
||||
INPUT_PROFILE: 'development',
|
||||
INPUT_BRANCH: 'preview-test',
|
||||
INPUT_PLATFORM: 'all',
|
||||
'INPUT_GITHUB-TOKEN': 'test-token',
|
||||
'INPUT_WORKING-DIRECTORY': '.',
|
||||
'INPUT_APP-SCHEME': value,
|
||||
};
|
||||
try {
|
||||
expect(collectContinuousDeployFingerprintInput().appScheme).toBe(expected);
|
||||
} finally {
|
||||
process.env = previous;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -4,17 +4,25 @@ import { createSummary, getVariables, previewInput } from '../../actions/preview
|
||||
import { EasUpdate } from '../../eas';
|
||||
|
||||
jest.mock('../../expo');
|
||||
jest.mock('../../worker');
|
||||
|
||||
const fakeOptions = {
|
||||
const fakeOptions: ReturnType<typeof previewInput> = {
|
||||
command: 'eas update',
|
||||
appScheme: undefined,
|
||||
shouldComment: true,
|
||||
commentId: 'preview-test',
|
||||
workingDirectory: '.',
|
||||
githubToken: 'test-token',
|
||||
qrTarget: 'dev-client',
|
||||
} as unknown as ReturnType<typeof previewInput>;
|
||||
};
|
||||
|
||||
const fakeExpoConfig = {
|
||||
const fakeExpoConfig: ExpoConfig = {
|
||||
name: 'Fake project',
|
||||
slug: 'fake-project',
|
||||
extra: {
|
||||
eas: { projectId: 'fake-project-id' },
|
||||
},
|
||||
} as unknown as ExpoConfig;
|
||||
};
|
||||
|
||||
const fakeUpdatesSingle: EasUpdate[] = [
|
||||
{
|
||||
@@ -46,6 +54,58 @@ const fakeUpdatesMultiple = fakeUpdatesSingle.map(update => ({
|
||||
group: `fake-group-${update.id}`,
|
||||
}));
|
||||
|
||||
describe(previewInput, () => {
|
||||
it('reads the native scheme override from the action input', () => {
|
||||
const previous = process.env['INPUT_APP-SCHEME'];
|
||||
process.env['INPUT_APP-SCHEME'] = 'myapp-dev';
|
||||
try {
|
||||
expect(previewInput().appScheme).toBe('myapp-dev');
|
||||
} finally {
|
||||
if (previous === undefined) {
|
||||
delete process.env['INPUT_APP-SCHEME'];
|
||||
} else {
|
||||
process.env['INPUT_APP-SCHEME'] = previous;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe(getVariables, () => {
|
||||
it('keeps the generated scheme when config contains a variant-specific scheme', () => {
|
||||
const vars = getVariables(
|
||||
{ ...fakeExpoConfig, scheme: 'myapp-production' },
|
||||
fakeUpdatesMultiple,
|
||||
fakeOptions
|
||||
);
|
||||
for (const value of [vars.qr, vars.androidQR, vars.iosQR]) {
|
||||
const qr = new URL(value);
|
||||
expect(qr.origin + qr.pathname).toBe('https://qr.expo.dev/eas-update');
|
||||
expect(qr.searchParams.get('appScheme')).toBe('fake-project');
|
||||
}
|
||||
});
|
||||
|
||||
it('uses an explicit native scheme for every update group and the comment', () => {
|
||||
const options = { ...fakeOptions, appScheme: 'myapp-dev' };
|
||||
const vars = getVariables(
|
||||
{ ...fakeExpoConfig, scheme: ['myapp-production', 'com.example.third-party-long'] },
|
||||
fakeUpdatesMultiple,
|
||||
options
|
||||
);
|
||||
expect(vars.projectScheme).toBe('myapp-dev');
|
||||
expect(JSON.parse(vars.projectSchemes)).toEqual(['myapp-dev']);
|
||||
for (const [value, group] of [
|
||||
[vars.qr, 'fake-group-fake-android-id'],
|
||||
[vars.androidQR, 'fake-group-fake-android-id'],
|
||||
[vars.iosQR, 'fake-group-fake-ios-id'],
|
||||
]) {
|
||||
const qr = new URL(value);
|
||||
expect(qr.origin + qr.pathname).toBe('https://qr.expo.dev/development-client');
|
||||
expect(qr.searchParams.get('appScheme')).toBe('myapp-dev');
|
||||
expect(qr.searchParams.get('url')).toBe(`https://u.expo.dev/fake-project-id/group/${group}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe(createSummary, () => {
|
||||
describe('single update group', () => {
|
||||
it('returns expected message for both platforms', () => {
|
||||
|
||||
@@ -1,10 +1,39 @@
|
||||
import { getUpdateGroupQr } from '../eas';
|
||||
|
||||
describe(getUpdateGroupQr, () => {
|
||||
it.each([
|
||||
{ staging: '', host: 'u.expo.dev' },
|
||||
{ staging: '1', host: 'staging-u.expo.dev' },
|
||||
])('uses the native scheme and $host for development builds', ({ staging, host }) => {
|
||||
const previous = process.env.EXPO_STAGING;
|
||||
process.env.EXPO_STAGING = staging;
|
||||
try {
|
||||
const qr = new URL(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'dev-build',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
appScheme: 'com.example.app-dev',
|
||||
})
|
||||
);
|
||||
expect(qr.origin + qr.pathname).toBe('https://qr.expo.dev/development-client');
|
||||
expect(qr.searchParams.get('appScheme')).toBe('com.example.app-dev');
|
||||
expect(qr.searchParams.get('url')).toBe(`https://${host}/projectId/group/updateGroupId`);
|
||||
} finally {
|
||||
if (previous === undefined) {
|
||||
delete process.env.EXPO_STAGING;
|
||||
} else {
|
||||
process.env.EXPO_STAGING = previous;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it('returns url for expo-go', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'expo-go',
|
||||
appScheme: 'myapp-dev',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
@@ -19,6 +48,7 @@ describe(getUpdateGroupQr, () => {
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
appScheme: undefined,
|
||||
})
|
||||
).toBe(
|
||||
'https://qr.expo.dev/eas-update?appScheme=appslug&projectId=projectId&groupId=updateGroupId'
|
||||
@@ -32,6 +62,7 @@ describe(getUpdateGroupQr, () => {
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'hello_world',
|
||||
appScheme: undefined,
|
||||
})
|
||||
).toBe(
|
||||
'https://qr.expo.dev/eas-update?appScheme=helloworld&projectId=projectId&groupId=updateGroupId'
|
||||
|
||||
@@ -2,7 +2,14 @@ import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
import { authenticate, parseCommand, projectDeepLink, projectLink, projectQR } from '../expo';
|
||||
import {
|
||||
authenticate,
|
||||
parseCommand,
|
||||
projectDeepLink,
|
||||
projectInfo,
|
||||
projectLink,
|
||||
projectQR,
|
||||
} from '../expo';
|
||||
|
||||
jest.mock('@actions/core');
|
||||
jest.mock('@actions/exec');
|
||||
@@ -51,6 +58,28 @@ describe(authenticate, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe(projectInfo, () => {
|
||||
it('resolves project info using the project Expo CLI', async () => {
|
||||
jest.mocked(exec.getExecOutput).mockResolvedValue({
|
||||
exitCode: 0,
|
||||
stdout: JSON.stringify({ name: 'fakename', slug: 'fakeslug', owner: 'fakeowner' }),
|
||||
stderr: '',
|
||||
});
|
||||
|
||||
await expect(projectInfo('fake/path')).resolves.toStrictEqual({
|
||||
name: 'fakename',
|
||||
slug: 'fakeslug',
|
||||
owner: 'fakeowner',
|
||||
});
|
||||
expect(exec.getExecOutput).toBeCalledWith(
|
||||
'npx',
|
||||
['expo', 'config', '--json', '--type', 'prebuild'],
|
||||
{ cwd: 'fake/path', silent: true }
|
||||
);
|
||||
expect(io.which).not.toBeCalledWith('expo', true);
|
||||
});
|
||||
});
|
||||
|
||||
describe(projectQR, () => {
|
||||
it('throws when owner is undefined', () => {
|
||||
expect(() => projectQR({ name: 'fakename', slug: 'fakeslug' })).toThrow('without owner');
|
||||
|
||||
@@ -30,6 +30,7 @@ export function collectContinuousDeployFingerprintInput() {
|
||||
branch: getInput('branch', { required: true }),
|
||||
platform: platformInput,
|
||||
environment: getInput('environment'),
|
||||
appScheme: getInput('app-scheme') || undefined,
|
||||
autoSubmitBuilds: getInput('auto-submit-builds') === 'true',
|
||||
githubToken: getInput('github-token', { required: true }),
|
||||
workingDirectory: getInput('working-directory', { required: true }),
|
||||
@@ -256,11 +257,16 @@ function createSummaryForUpdatesAndBuilds({
|
||||
projectId: string;
|
||||
updates: EasUpdate[];
|
||||
buildRunInfos: { androidBuildRunInfo?: BuildRunInfo; iosBuildRunInfo?: BuildRunInfo };
|
||||
options: { qrTarget?: 'expo-go' | 'dev-build' | 'dev-client'; workingDirectory: string };
|
||||
options: {
|
||||
qrTarget?: 'expo-go' | 'dev-build' | 'dev-client';
|
||||
workingDirectory: string;
|
||||
appScheme: string | undefined;
|
||||
};
|
||||
}) {
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = getQrTarget(options);
|
||||
const appSchemes = getSchemesInOrderFromConfig(config) || [];
|
||||
const appScheme = options.appScheme;
|
||||
const appSchemes = appScheme ? [appScheme] : getSchemesInOrderFromConfig(config) || [];
|
||||
|
||||
const { androidBuildRunInfo, iosBuildRunInfo } = buildRunInfos;
|
||||
|
||||
@@ -274,7 +280,9 @@ function createSummaryForUpdatesAndBuilds({
|
||||
? `[Update Permalink](${getUpdateGroupWebsite({ projectId, updateGroupId: update.group })})`
|
||||
: 'n/a';
|
||||
const getUpdateQRURL = (update: EasUpdate | undefined) =>
|
||||
update ? getUpdateGroupQr({ projectId, updateGroupId: update.group, appSlug, qrTarget }) : null;
|
||||
update
|
||||
? getUpdateGroupQr({ projectId, updateGroupId: update.group, appSlug, appScheme, qrTarget })
|
||||
: null;
|
||||
const getBuildDetails = (buildRunInfo: BuildRunInfo) =>
|
||||
getBuildLink(buildRunInfo.buildInfo) +
|
||||
'<br />' +
|
||||
|
||||
+16
-6
@@ -24,6 +24,7 @@ export function previewInput() {
|
||||
|
||||
return {
|
||||
command: getInput('command'),
|
||||
appScheme: getInput('app-scheme') || undefined,
|
||||
shouldComment: !getInput('comment') || getBooleanInput('comment'),
|
||||
commentId: getInput('comment-id') || MESSAGE_ID,
|
||||
workingDirectory: getInput('working-directory'),
|
||||
@@ -120,7 +121,8 @@ export function getVariables(
|
||||
const android = updates.find(update => update.platform === 'android');
|
||||
const ios = updates.find(update => update.platform === 'ios');
|
||||
|
||||
const appSchemes = getSchemesInOrderFromConfig(config) || [];
|
||||
const appScheme = options.appScheme;
|
||||
const appSchemes = appScheme ? [appScheme] : getSchemesInOrderFromConfig(config) || [];
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = getQrTarget(options);
|
||||
|
||||
@@ -129,13 +131,19 @@ export function getVariables(
|
||||
projectId,
|
||||
projectName: config.name,
|
||||
projectSlug: appSlug,
|
||||
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
|
||||
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
|
||||
projectScheme: appSchemes[0] || '', // The override, or the longest configured app scheme
|
||||
projectSchemes: JSON.stringify(appSchemes), // The override, or configured app schemes in priority order as JSON
|
||||
// Shared update properties
|
||||
// Note, only use these properties when the update groups are identical
|
||||
groupId: updates[0].group,
|
||||
runtimeVersion: updates[0].runtimeVersion,
|
||||
qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
|
||||
qr: getUpdateGroupQr({
|
||||
projectId,
|
||||
updateGroupId: updates[0].group,
|
||||
appSlug,
|
||||
appScheme,
|
||||
qrTarget,
|
||||
}),
|
||||
link: getUpdateGroupWebsite({ projectId, updateGroupId: updates[0].group }),
|
||||
// These are safe to access regardless of the update groups
|
||||
branchName: updates[0].branch,
|
||||
@@ -150,7 +158,7 @@ export function getVariables(
|
||||
androidMessage: android?.message || '',
|
||||
androidRuntimeVersion: android?.runtimeVersion || '',
|
||||
androidQR: android
|
||||
? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, qrTarget })
|
||||
? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, appScheme, qrTarget })
|
||||
: '',
|
||||
androidLink: android ? getUpdateGroupWebsite({ projectId, updateGroupId: android.group }) : '',
|
||||
// iOS update
|
||||
@@ -160,7 +168,9 @@ export function getVariables(
|
||||
iosManifestPermalink: ios?.manifestPermalink || '',
|
||||
iosMessage: ios?.message || '',
|
||||
iosRuntimeVersion: ios?.runtimeVersion || '',
|
||||
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
|
||||
iosQR: ios
|
||||
? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, appScheme, qrTarget })
|
||||
: '',
|
||||
iosLink: ios ? getUpdateGroupWebsite({ projectId, updateGroupId: ios.group }) : '',
|
||||
};
|
||||
}
|
||||
|
||||
+12
@@ -74,13 +74,25 @@ export function getUpdateGroupQr({
|
||||
projectId,
|
||||
updateGroupId,
|
||||
appSlug,
|
||||
appScheme,
|
||||
qrTarget,
|
||||
}: {
|
||||
projectId: string;
|
||||
updateGroupId: string;
|
||||
appSlug: string;
|
||||
appScheme: string | undefined;
|
||||
qrTarget: 'expo-go' | 'dev-build';
|
||||
}): string {
|
||||
if (qrTarget === 'dev-build' && appScheme) {
|
||||
// /eas-update treats appScheme as a slug and prefixes it with exp+.
|
||||
// /development-client uses the native scheme verbatim instead.
|
||||
const url = new URL('https://qr.expo.dev/development-client');
|
||||
const host = process.env.EXPO_STAGING ? 'staging-u.expo.dev' : 'u.expo.dev';
|
||||
url.searchParams.append('appScheme', appScheme);
|
||||
url.searchParams.append('url', `https://${host}/${projectId}/group/${updateGroupId}`);
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
const url = new URL('https://qr.expo.dev/eas-update');
|
||||
|
||||
if (qrTarget === 'dev-build') {
|
||||
|
||||
+31
-12
@@ -56,6 +56,29 @@ export type BuildInfo = {
|
||||
status: BuildStatus;
|
||||
};
|
||||
|
||||
type EasCliBuildJson = Omit<BuildInfo, 'project' | 'channel' | 'runtimeVersion'> & {
|
||||
project?: BuildInfo['project'];
|
||||
app?: BuildInfo['project'];
|
||||
channel?: string;
|
||||
updateChannel?: { name: string } | null;
|
||||
runtimeVersion?: string;
|
||||
runtime?: { version: string } | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert the build JSON from any eas-cli version to `BuildInfo`.
|
||||
* eas-cli 22 moved `project`, `channel`, and `runtimeVersion` to `app`, `updateChannel`, and `runtime`.
|
||||
*/
|
||||
export function normalizeBuildInfo(build: EasCliBuildJson): BuildInfo {
|
||||
const { app, updateChannel, runtime, ...rest } = build;
|
||||
return {
|
||||
...rest,
|
||||
project: (build.project ?? app)!,
|
||||
channel: (build.channel ?? updateChannel?.name)!,
|
||||
runtimeVersion: build.runtimeVersion ?? runtime?.version,
|
||||
};
|
||||
}
|
||||
|
||||
export const appPlatformDisplayNames: Record<AppPlatform, string> = {
|
||||
[AppPlatform.Android]: 'Android',
|
||||
[AppPlatform.Ios]: 'iOS',
|
||||
@@ -154,7 +177,7 @@ export async function easBuild(cmd: Command): Promise<BuildInfo[]> {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
return (JSON.parse(stdout) as EasCliBuildJson[]).map(normalizeBuildInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,7 +209,7 @@ export async function createEasBuildFromRawCommandAsync(
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
return (JSON.parse(stdout) as EasCliBuildJson[]).map(normalizeBuildInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,7 +239,7 @@ export async function queryEasBuildInfoAsync(
|
||||
silent: true,
|
||||
}
|
||||
);
|
||||
return JSON.parse(stdout);
|
||||
return normalizeBuildInfo(JSON.parse(stdout));
|
||||
} catch (error: unknown) {
|
||||
info(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
}
|
||||
@@ -224,20 +247,16 @@ export async function queryEasBuildInfoAsync(
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to resolve the project info, by running 'expo config --type prebuild'.
|
||||
* Try to resolve the project info using the app's own Expo CLI.
|
||||
*/
|
||||
export async function projectInfo(dir: string): Promise<ProjectInfo> {
|
||||
let stdout = '';
|
||||
|
||||
try {
|
||||
({ stdout } = await getExecOutput(
|
||||
await which('expo', true),
|
||||
['config', '--json', '--type', 'prebuild'],
|
||||
{
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}
|
||||
));
|
||||
({ stdout } = await getExecOutput('npx', ['expo', 'config', '--json', '--type', 'prebuild'], {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not fetch the project info from ${dir}`, { cause: error });
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { info, isDebug } from '@actions/core';
|
||||
import { getExecOutput } from '@actions/exec';
|
||||
import { which } from '@actions/io';
|
||||
|
||||
import { BuildInfo, BuildStatus } from './expo';
|
||||
import { BuildInfo, BuildStatus, normalizeBuildInfo } from './expo';
|
||||
|
||||
export async function getBuildInfoForCurrentFingerprintAsync({
|
||||
platform,
|
||||
@@ -124,7 +124,8 @@ export async function getBuildInfoWithFingerprintAsync({
|
||||
silent: !isDebug(),
|
||||
}
|
||||
);
|
||||
builds = JSON.parse(stdout);
|
||||
const parsed = JSON.parse(stdout);
|
||||
builds = Array.isArray(parsed) ? parsed.map(normalizeBuildInfo) : parsed;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Error getting EAS builds: ${String(error)}`, { cause: error });
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "@tsconfig/node20",
|
||||
"extends": "@tsconfig/node24",
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
|
||||
Reference in new issue
Block a user