-
Notifications
You must be signed in to change notification settings - Fork 476
643 lines (536 loc) Β· 26.2 KB
/
release.yml
File metadata and controls
643 lines (536 loc) Β· 26.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
name: Build and Release
on:
push:
tags:
- 'v*.*.*' # Official release tags (e.g., v3.1.1)
- 'v*.*.*-beta*' # Beta releases (e.g., v3.1.1-beta1)
- 'v*.*.*-alpha*' # Alpha releases (e.g., v3.1.1-alpha1)
- 'v*.*.*-rc*' # Release candidates (e.g., v3.1.1-rc1)
workflow_dispatch:
inputs:
version:
description: 'Version number to build (e.g., v3.1.1 or v3.1.1-beta1). Tag does not need to exist β this is a dry-run: artifacts are saved in the workflow run only, nothing is published.'
required: true
type: string
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
validate-and-release:
name: Validate Version and Build Release
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating releases and uploading artifacts
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup NDK
uses: nttld/setup-ndk@v1.4.2
id: setup-ndk
with:
ndk-version: r27c
link-to-sdk: true
add-to-path: true
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y ninja-build jq rsync binutils unzip
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Cache NDK and CMake builds
uses: actions/cache@v4
with:
path: |
~/.android/build-cache
library/.cxx
library/build
key: ${{ runner.os }}-ndk-${{ hashFiles('**/*.gradle*', '**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-ndk-
- name: Grant execute permission for scripts
run: chmod +x gradlew tasks.sh publish.sh
- name: Extract tag version
id: tag_version
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
# Determine if this is a manual trigger or tag push
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
# Manual trigger - accept tag name (with or without leading v)
RAW_VERSION="$INPUT_VERSION"
RAW_VERSION="${RAW_VERSION#${RAW_VERSION%%[![:space:]]*}}"
RAW_VERSION="${RAW_VERSION%${RAW_VERSION##*[![:space:]]}}"
if [ -z "$RAW_VERSION" ]; then
echo "β Version input cannot be empty"
exit 1
fi
# Accept either "v3.1.1-beta1" or "3.1.1-beta1"
VERSION="${RAW_VERSION#v}"
TAG_NAME="v$VERSION"
IS_MANUAL="true"
IS_PUBLISH="false"
echo "π§ Dry-run triggered manually (artifacts only, nothing published)"
else
# Tag push - extract from ref
TAG_NAME="${GITHUB_REF#refs/tags/}"
IS_MANUAL="false"
IS_PUBLISH="true"
fi
# Extract and validate version numbers supporting prerelease tags
# e.g., v3.1.1-beta1 -> base=3.1.1, version=3.1.1-beta1
if [[ $TAG_NAME =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9\.]+)?$ ]]; then
BASE_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
PRERELEASE_SUFFIX="${BASH_REMATCH[4]}"
VERSION="${BASE_VERSION}${PRERELEASE_SUFFIX}"
if [ -n "$PRERELEASE_SUFFIX" ]; then
IS_PRERELEASE="true"
echo "π§ͺ Prerelease detected: $PRERELEASE_SUFFIX"
else
IS_PRERELEASE="false"
fi
else
echo "β Invalid tag format: $TAG_NAME"
echo "Tag must be: v{major}.{minor}.{patch}[-prerelease] (e.g., v3.1.1 or v3.1.1-beta1)"
exit 1
fi
# Validate base version format
if [[ ! $BASE_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "β Invalid base version format: $BASE_VERSION"
echo "Version must be in format: \${major}.\${minor}.\${patch} (e.g., 3.1.1)"
exit 1
fi
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "base_version=$BASE_VERSION" >> $GITHUB_OUTPUT
echo "is_manual=$IS_MANUAL" >> $GITHUB_OUTPUT
echo "is_publish=$IS_PUBLISH" >> $GITHUB_OUTPUT
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
echo "β
Valid version: $VERSION (tag: $TAG_NAME, prerelease: $IS_PRERELEASE, manual: $IS_MANUAL, publish: $IS_PUBLISH)"
- name: Validate tag is on master branch (official releases only)
if: steps.tag_version.outputs.is_prerelease == 'false' && steps.tag_version.outputs.is_manual == 'false'
run: |
TAG_NAME="${{ steps.tag_version.outputs.tag_name }}"
echo "π Validating that $TAG_NAME points to a commit on the master branch..."
# Resolve the commit the tag points to (dereference annotated tags)
if ! TAG_COMMIT=$(git rev-parse "${TAG_NAME}^{commit}" 2>/dev/null); then
echo "β Could not resolve tag commit for $TAG_NAME β does the tag exist in this repo?"
exit 1
fi
echo "Tag commit: $TAG_COMMIT"
# Fetch latest master to ensure our ref is up to date (full fetch, no shallow boundary)
if ! git fetch origin master; then
echo "β Failed to fetch origin/master. Cannot validate that $TAG_NAME is on the master branch."
exit 1
fi
# Check whether TAG_COMMIT is reachable from origin/master
if git merge-base --is-ancestor "$TAG_COMMIT" origin/master; then
echo "β
$TAG_NAME is on the master branch"
else
echo "β $TAG_NAME is NOT on the master branch!"
echo "Official release tags must point to a commit that exists in master."
echo "Tag commit : $TAG_COMMIT"
echo "Please create the tag from the master branch and try again."
exit 1
fi
- name: Validate version matches project version
run: |
PROJECT_VERSION=$(grep -E 'versionName\s*:' build.gradle | sed -E 's/.*versionName\s*:\s*"([^"]+)".*/\1/')
TAG_VERSION="${{ steps.tag_version.outputs.version }}"
BASE_VERSION="${{ steps.tag_version.outputs.base_version }}"
echo "Project version (build.gradle): $PROJECT_VERSION"
echo "Tag full version: $TAG_VERSION"
echo "Tag base version: $BASE_VERSION"
# For prerelease tags (e.g., v3.1.1-beta1), only the base version (3.1.1)
# needs to match build.gradle. This allows tagging prereleases without
# updating build.gradle every time.
if [ "$PROJECT_VERSION" = "$TAG_VERSION" ]; then
echo "β
Exact version match: $TAG_VERSION"
elif [ "$PROJECT_VERSION" = "$BASE_VERSION" ] && [ "$TAG_VERSION" != "$BASE_VERSION" ]; then
echo "β
Base version match for prerelease: build.gradle=$PROJECT_VERSION, tag=$TAG_VERSION"
else
echo "β Version mismatch!"
echo "build.gradle versionName ($PROJECT_VERSION) does not match tag version ($TAG_VERSION) or base version ($BASE_VERSION)"
echo "Please ensure build.gradle versionName matches the tag's base version."
exit 1
fi
- name: Setup local.properties for publishing
run: |
# Create local.properties with necessary configurations
mkdir -p /tmp/maven-repo
cat > local.properties << EOF
usingCMakeCompile=true
usingCMakeCompileDebug=false
deployArtifacts=true
localRepoDir=/tmp/maven-repo
EOF
echo "β
local.properties configured for publishing"
cat local.properties
- name: Build all artifact variants
id: build_variants
run: |
BUILD_START=$(date +%s)
echo "π¨ Building all 4 artifact variants..."
bash -e ./publish.sh
BUILD_END=$(date +%s)
BUILD_TIME=$((BUILD_END - BUILD_START))
echo "β
All artifacts built successfully"
echo "β±οΈ Build time: $((BUILD_TIME / 60)) minutes $((BUILD_TIME % 60)) seconds"
echo "π¦ Generated artifacts:"
find /tmp/maven-repo -type f \( -name "*.aar" -o -name "*.pom" \) | sort
echo "build_time=$BUILD_TIME" >> $GITHUB_OUTPUT
- name: Build demo APK with video module
run: |
echo "π¨ Building demo APK with video module..."
./tasks.sh --enable-cmake --release --enable-video-module --enable-16kb-page-size --build
# Find and copy the APK (look specifically for release build output)
APK_PATH=$(find "cgeDemo/build/outputs/apk/release" \( -name "*-release.apk" -o -name "*-release-unsigned.apk" \) | head -1)
if [ -z "$APK_PATH" ]; then
# Fallback: search in build directory
APK_PATH=$(find "cgeDemo/build" -path "*/release/*" -name "*.apk" | head -1)
fi
if [ -z "$APK_PATH" ]; then
echo "β APK not found!"
echo "Searched locations:"
find "cgeDemo/build" -name "*.apk" || echo "No APK files found"
exit 1
fi
mkdir -p /tmp/release-artifacts
cp "$APK_PATH" /tmp/release-artifacts/cgeDemo-${{ steps.tag_version.outputs.version }}.apk
echo "β
Demo APK built successfully"
ls -lh /tmp/release-artifacts/
- name: Validate APK size and properties
run: |
echo "π Checking APK size and basic properties..."
APK_FILE=$(ls /tmp/release-artifacts/*.apk | head -1)
APK_SIZE=$(stat -c%s "$APK_FILE" 2>/dev/null || stat -f%z "$APK_FILE")
APK_SIZE_MB=$((APK_SIZE / 1024 / 1024))
echo "π¦ APK size: ${APK_SIZE_MB} MB"
# Warn if APK is unusually large
if [ $APK_SIZE -gt 104857600 ]; then # 100MB
echo "::warning::APK size (${APK_SIZE_MB} MB) exceeds 100MB, consider optimization"
fi
# Warn if APK is unusually small (might indicate build issue)
if [ $APK_SIZE -lt 5242880 ]; then # 5MB
echo "::warning::APK size (${APK_SIZE_MB} MB) is unusually small, please verify"
fi
echo "β
APK validation passed"
- name: Validate native libs max page size (16KB)
run: |
echo "π Validating native library max page size in APK..."
APK_FILE=$(ls /tmp/release-artifacts/*.apk | head -1)
EXTRACT_DIR="/tmp/apk-native-check"
rm -rf "$EXTRACT_DIR"
mkdir -p "$EXTRACT_DIR"
unzip -q "$APK_FILE" "lib/*.so" -d "$EXTRACT_DIR"
SO_COUNT=$(find "$EXTRACT_DIR/lib" -type f -name "*.so" | wc -l | tr -d ' ')
if [ "$SO_COUNT" -eq 0 ]; then
echo "β No native libraries found in APK: $APK_FILE"
exit 1
fi
while IFS= read -r so_file; do
max_align=0
while IFS= read -r align_hex; do
align_hex=${align_hex#0x}
if [ -z "$align_hex" ]; then
continue
fi
align_dec=$((16#$align_hex))
if [ "$align_dec" -gt "$max_align" ]; then
max_align="$align_dec"
fi
done < <(readelf -l "$so_file" | awk '/LOAD/ {print $NF}')
if [ "$max_align" -lt 16384 ]; then
echo "β Invalid max page size in $(basename "$so_file"): ${max_align} bytes (< 16384)"
readelf -l "$so_file"
exit 1
fi
printf " β %s max LOAD align: %d bytes\n" "$(basename "$so_file")" "$max_align"
done < <(find "$EXTRACT_DIR/lib" -type f -name "*.so" | sort)
echo "β
Native library max page size validation passed"
- name: Package AAR artifacts
run: |
echo "π¦ Packaging AAR artifacts..."
VERSION="${{ steps.tag_version.outputs.version }}"
MAVEN_REPO="/tmp/maven-repo"
ARTIFACTS_DIR="/tmp/release-artifacts"
# Find and copy all AAR files from the maven repository
# Expected structure: /tmp/maven-repo/org/wysaid/gpuimage-plus/{version}/gpuimage-plus-{version}.aar
while IFS= read -r aar_file; do
if [ -n "$aar_file" ]; then
filename=$(basename "$aar_file")
cp "$aar_file" "$ARTIFACTS_DIR/$filename"
echo " β Packaged: $filename"
fi
done < <(find "$MAVEN_REPO/org/wysaid/gpuimage-plus" -name "*.aar")
# Validate that we have exactly 4 AAR files
AAR_COUNT=$(find "$ARTIFACTS_DIR" -name "*.aar" | wc -l)
if [ "$AAR_COUNT" -ne 4 ]; then
echo "β Expected 4 AAR files but found $AAR_COUNT"
exit 1
fi
echo "β
All AAR artifacts packaged ($AAR_COUNT files)"
echo "π¦ Final artifacts:"
ls -lh "$ARTIFACTS_DIR/"
- name: Generate artifact checksums
run: |
echo "π Generating SHA256 checksums for all artifacts..."
cd /tmp/release-artifacts
# Generate checksums for all files
sha256sum *.apk *.aar > SHA256SUMS.txt 2>/dev/null || shasum -a 256 *.apk *.aar > SHA256SUMS.txt
echo "β
Checksums generated:"
cat SHA256SUMS.txt
# Also create individual checksum files for convenience
for file in *.apk *.aar; do
if [ -f "$file" ]; then
sha256sum "$file" > "${file}.sha256" 2>/dev/null || shasum -a 256 "$file" > "${file}.sha256"
fi
done
echo "β
Individual checksum files created"
- name: Sync artifacts to maven repo
if: steps.tag_version.outputs.is_publish == 'true'
id: sync_maven_repo
env:
ARTIFACT_REPO_TOKEN: ${{ secrets.ARTIFACT_REPO_TOKEN }}
run: |
set -euo pipefail
VERSION="${{ steps.tag_version.outputs.version }}"
TAG_NAME="${{ steps.tag_version.outputs.tag_name }}"
if [[ -z "${ARTIFACT_REPO_TOKEN:-}" ]]; then
echo "::error::ARTIFACT_REPO_TOKEN is not configured. This secret is required to publish artifacts to the Maven repository."
echo "Please add ARTIFACT_REPO_TOKEN to the repository secrets: Settings β Secrets and variables β Actions β New repository secret"
exit 1
fi
ARTIFACT_REPO="wysaid/android-gpuimage-plus-maven"
WORKDIR="/tmp/maven-repo-target"
SOURCE_REPO="/tmp/maven-repo"
echo "π Cloning artifact repo..."
git clone --depth 1 "https://${ARTIFACT_REPO_TOKEN}@github.com/${ARTIFACT_REPO}.git" "$WORKDIR"
echo "π Syncing generated Maven artifacts..."
mkdir -p "$WORKDIR/org/wysaid/gpuimage-plus"
if [ ! -d "${SOURCE_REPO}/org/wysaid/gpuimage-plus" ]; then
echo "β Source artifacts not found: ${SOURCE_REPO}/org/wysaid/gpuimage-plus"
exit 1
fi
# Additive sync: keep previously published versions in artifact repo.
rsync -av "${SOURCE_REPO}/org/wysaid/gpuimage-plus/" "$WORKDIR/org/wysaid/gpuimage-plus/"
echo "π§ Regenerating index pages"
pushd "$WORKDIR"
chmod +x genSites.sh
./genSites.sh
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add org/wysaid/gpuimage-plus || true
echo "artifact_commit_url=" >> $GITHUB_OUTPUT
if git diff --cached --quiet; then
echo "βΉοΈ No changes to publish; skipping commit."
popd
exit 0
fi
git commit -m "Publish artifacts ${TAG_NAME}"
# Retry push up to 3 times to handle transient non-fast-forward conflicts
PUSH_ATTEMPTS=0
until git push origin master; do
PUSH_ATTEMPTS=$((PUSH_ATTEMPTS + 1))
if [ "$PUSH_ATTEMPTS" -ge 3 ]; then
echo "::error::Maven artifact push failed after $PUSH_ATTEMPTS attempts (possible concurrent push). Re-run the sync step manually for tag $TAG_NAME."
exit 1
fi
echo "β οΈ Push attempt $PUSH_ATTEMPTS failed; retrying after fetch+rebase..."
git fetch origin master && git rebase origin/master
done
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_URL="https://github.com/${ARTIFACT_REPO}/commit/${COMMIT_SHA}"
echo "β
Artifacts pushed to maven repo: $COMMIT_URL"
echo "artifact_commit_url=$COMMIT_URL" >> $GITHUB_OUTPUT
popd
- name: Generate release notes
id: release_notes
run: |
VERSION="${{ steps.tag_version.outputs.version }}"
TAG_NAME="${{ steps.tag_version.outputs.tag_name }}"
cat > /tmp/release_notes.md << EOF
## π Android GPUImage Plus $TAG_NAME
### π¦ Downloads
**Demo APK:**
- \`cgeDemo-$VERSION.apk\` - Demo application with full video features
**AAR Library Artifacts:**
Four variants are available for different use cases:
1. **gpuimage-plus-$VERSION.aar**
- Page size: 4KB (default)
- Full-featured with FFmpeg bundled
- Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
2. **gpuimage-plus-$VERSION-16k.aar**
- Page size: 16KB
- Full-featured with FFmpeg bundled
- Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
3. **gpuimage-plus-$VERSION-min.aar**
- Page size: 4KB (default)
- Image-only version (no video features or FFmpeg)
- Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
4. **gpuimage-plus-$VERSION-16k-min.aar**
- Page size: 16KB
- Image-only version (no video features or FFmpeg)
- Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
### π§ Gradle Dependency
\`\`\`gradle
allprojects {
repositories {
maven {
url 'https://maven.wysaid.org/'
}
}
}
dependencies {
// Choose one of the following based on your needs:
// Full-featured with FFmpeg (4KB page size)
implementation 'org.wysaid:gpuimage-plus:$VERSION'
// Full-featured with FFmpeg (16KB page size)
implementation 'org.wysaid:gpuimage-plus:$VERSION-16k'
// Image-only, no video (4KB page size)
implementation 'org.wysaid:gpuimage-plus:$VERSION-min'
// Image-only, no video (16KB page size)
implementation 'org.wysaid:gpuimage-plus:$VERSION-16k-min'
}
\`\`\`
### π System Requirements
- **Minimum Android SDK**: API 21 (Android 5.0)
- **Target Android SDK**: API 25
- **NDK Version**: r27c
- **Supported Architectures**: armeabi-v7a, arm64-v8a, x86, x86_64
### π Documentation
- **GitHub Repository**: https://github.com/wysaid/android-gpuimage-plus
- **Build & Integration Guide**: https://github.com/wysaid/android-gpuimage-plus/blob/master/docs/build.md
- **Filter Rule Documentation**: https://github.com/wysaid/android-gpuimage-plus/blob/master/docs/filter-rules.md
---
For complete changelog, see the auto-generated content below.
EOF
echo "β
Release notes generated"
- name: Create GitHub Release
if: steps.tag_version.outputs.is_publish == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag_version.outputs.tag_name }}
name: Release ${{ steps.tag_version.outputs.tag_name }}
body_path: /tmp/release_notes.md
files: |
/tmp/release-artifacts/*.apk
/tmp/release-artifacts/*.aar
/tmp/release-artifacts/SHA256SUMS.txt
/tmp/release-artifacts/*.sha256
draft: true
prerelease: ${{ steps.tag_version.outputs.is_prerelease == 'true' }}
generate_release_notes: true
make_latest: ${{ steps.tag_version.outputs.is_prerelease != 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts (build-only mode)
if: steps.tag_version.outputs.is_publish != 'true'
uses: actions/upload-artifact@v4
with:
name: release-artifacts-${{ steps.tag_version.outputs.version }}
path: /tmp/release-artifacts/
retention-days: 7
- name: Build-only mode success message
if: steps.tag_version.outputs.is_publish != 'true'
run: |
echo "π ============================================"
echo "π Build completed successfully (artifacts only)!"
echo "π ============================================"
echo ""
echo "π¦ Version: ${{ steps.tag_version.outputs.version }}"
echo "π¦ Artifacts are available for download from the workflow run."
echo ""
echo "βΉοΈ This was a manual dry-run β nothing was published."
echo "βΉοΈ To make a real release, push the tag from master:"
echo " git tag ${{ steps.tag_version.outputs.tag_name }} && git push origin ${{ steps.tag_version.outputs.tag_name }}"
echo ""
echo "π¦ Built artifacts:"
ls -lh /tmp/release-artifacts/
- name: Summary
run: |
IS_PUBLISH="${{ steps.tag_version.outputs.is_publish }}"
IS_MANUAL="${{ steps.tag_version.outputs.is_manual }}"
VERSION="${{ steps.tag_version.outputs.version }}"
TAG_NAME="${{ steps.tag_version.outputs.tag_name }}"
if [ "$IS_PUBLISH" != "true" ]; then
echo "## π§ Dry-Run Build Completed Successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version**: $VERSION" >> $GITHUB_STEP_SUMMARY
echo "**Trigger**: Manual dry-run (workflow_dispatch)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### βΉοΈ Nothing was published" >> $GITHUB_STEP_SUMMARY
echo "Artifacts are retained in this workflow run for **7 days**." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "To make a real release, push the tag from master:" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "git tag $TAG_NAME && git push origin $TAG_NAME" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### π¦ Built Artifacts (available for download):" >> $GITHUB_STEP_SUMMARY
else
echo "## π Release Draft Created Successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Release**: $TAG_NAME" >> $GITHUB_STEP_SUMMARY
echo "**Version**: $VERSION" >> $GITHUB_STEP_SUMMARY
echo "**Trigger**: Tag push" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### β
Version Validation" >> $GITHUB_STEP_SUMMARY
echo "- β
Tag format validated: v\${major}.\${minor}.\${patch}" >> $GITHUB_STEP_SUMMARY
echo "- β
Version matches project version in build.gradle" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### π¦ Released Artifacts:" >> $GITHUB_STEP_SUMMARY
fi
echo "**Demo APK:**" >> $GITHUB_STEP_SUMMARY
echo "- cgeDemo-$VERSION.apk (video enabled)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**AAR Libraries:**" >> $GITHUB_STEP_SUMMARY
echo "- gpuimage-plus-$VERSION.aar (4KB, with video)" >> $GITHUB_STEP_SUMMARY
echo "- gpuimage-plus-$VERSION-16k.aar (16KB, with video)" >> $GITHUB_STEP_SUMMARY
echo "- gpuimage-plus-$VERSION-min.aar (4KB, image-only)" >> $GITHUB_STEP_SUMMARY
echo "- gpuimage-plus-$VERSION-16k-min.aar (16KB, image-only)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "$IS_PUBLISH" = "true" ]; then
echo "Review and publish the draft release: ${{ github.server_url }}/${{ github.repository }}/releases" >> $GITHUB_STEP_SUMMARY
echo "(Draft tag: $TAG_NAME)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**β οΈ Action required**: Go to the releases page, review the draft, then click *Publish release* to make it public." >> $GITHUB_STEP_SUMMARY
fi
ARTIFACT_COMMIT_URL="${{ steps.sync_maven_repo.outputs.artifact_commit_url }}"
if [ -n "$ARTIFACT_COMMIT_URL" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### π¦ Maven Artifact Repository" >> $GITHUB_STEP_SUMMARY
echo "- Commit: $ARTIFACT_COMMIT_URL" >> $GITHUB_STEP_SUMMARY
echo "- Browse: https://maven.wysaid.org/org/wysaid/gpuimage-plus/" >> $GITHUB_STEP_SUMMARY
fi
# Add build time if available
BUILD_TIME="${{ steps.build_variants.outputs.build_time }}"
if [ -n "$BUILD_TIME" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### β±οΈ Build Performance" >> $GITHUB_STEP_SUMMARY
echo "- Total build time: $((BUILD_TIME / 60)) minutes $((BUILD_TIME % 60)) seconds" >> $GITHUB_STEP_SUMMARY
fi
- name: Build failure notification
if: failure()
env:
FAILURE_VERSION: ${{ steps.tag_version.outputs.version || github.event.inputs.version || 'unknown' }}
FAILURE_TAG: ${{ steps.tag_version.outputs.tag_name || github.ref_name || 'unknown' }}
run: |
echo "::error::Release build failed for version ${FAILURE_VERSION}"
echo "" >> $GITHUB_STEP_SUMMARY
echo "## β Build Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version**: ${FAILURE_VERSION}" >> $GITHUB_STEP_SUMMARY
echo "**Tag**: ${FAILURE_TAG}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Please check the workflow logs for details." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### π Common Issues" >> $GITHUB_STEP_SUMMARY
echo "- Version mismatch between tag and build.gradle" >> $GITHUB_STEP_SUMMARY
echo "- NDK/CMake configuration issues" >> $GITHUB_STEP_SUMMARY
echo "- Missing dependencies or build tools" >> $GITHUB_STEP_SUMMARY
echo "- Network issues during artifact sync" >> $GITHUB_STEP_SUMMARY