mirror of
https://gitee.com/wanwujie/sub2api-mobile
synced 2026-04-02 22:42:14 +08:00
ci: publish EAS build links in workflow summary
This commit is contained in:
36
.github/workflows/eas-build.yml
vendored
36
.github/workflows/eas-build.yml
vendored
@@ -48,5 +48,37 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Trigger EAS build
|
||||
run: npx eas build --non-interactive --profile "${{ inputs.profile }}" --platform "${{ inputs.platform }}"
|
||||
- name: Trigger EAS build and wait for completion
|
||||
run: npx eas build --non-interactive --wait --json --profile "${{ inputs.profile }}" --platform "${{ inputs.platform }}" > eas-build.json
|
||||
|
||||
- name: Publish build links in workflow summary
|
||||
run: |
|
||||
node <<'EOF'
|
||||
const fs = require('node:fs');
|
||||
|
||||
const raw = fs.readFileSync('eas-build.json', 'utf8').trim();
|
||||
const parsed = JSON.parse(raw);
|
||||
const builds = Array.isArray(parsed) ? parsed : [parsed];
|
||||
|
||||
const lines = [];
|
||||
for (const build of builds) {
|
||||
const platform = String(build.platform || 'unknown').toUpperCase();
|
||||
const detailsUrl = build.buildDetailsPageUrl || build.detailsPageUrl || build.url;
|
||||
const downloadUrl = build?.artifacts?.buildUrl || build?.artifacts?.applicationArchiveUrl;
|
||||
|
||||
if (detailsUrl) {
|
||||
lines.push(`- ${platform} details: ${detailsUrl}`);
|
||||
}
|
||||
if (downloadUrl) {
|
||||
lines.push(`- ${platform} download: ${downloadUrl}`);
|
||||
}
|
||||
}
|
||||
|
||||
const summary = [
|
||||
'## EAS Build Results',
|
||||
'',
|
||||
...(lines.length > 0 ? lines : ['- Build finished, but no URLs were returned by EAS CLI.'])
|
||||
].join('\n');
|
||||
|
||||
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, `${summary}\n`);
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user