Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Implements automated release workflow triggered by version tags (e.g., v3.1.1) that validates tag-project version consistency and publishes all release artifacts.

Changes

Workflow (.github/workflows/release.yml)

  • Triggers on v*.*.* tags with numeric version validation
  • Validates tag version matches versionName in build.gradle, fails on mismatch
  • Builds all 4 AAR variants via publish.sh (4KB/16KB page sizes × with/without video module)
  • Builds demo APK with FFmpeg/video features
  • Creates GitHub release with 5 artifacts and generated release notes
  • Permissions: contents: write only

Documentation (README.md)

  • Added "Release Process" section with version bumping and tag creation workflow
  • Documents automatic validation and artifact generation behavior

Artifact Output

Each release produces:

  • gpuimage-plus-{version}.aar (default: 4KB, FFmpeg)
  • gpuimage-plus-{version}-16k.aar (16KB page, FFmpeg)
  • gpuimage-plus-{version}-min.aar (4KB, image-only)
  • gpuimage-plus-{version}-16k-min.aar (16KB page, image-only)
  • cgeDemo-{version}.apk (demo with video)

Version mismatch example:

# Tag v3.1.2 but build.gradle has versionName: "3.1.1"
❌ Version mismatch!
Tag version (3.1.2) does not match project version (3.1.1)
Original prompt

任务: 完善工作流, 增加基于 tag 的发布流程。
描述:这是一个安卓项目, 请审查里面内置的 gradle 任务, 以获得所有的执行任务。也审查一下 tasks.sh 以及 tasks.json 获得完整的项目编译以及执行的任务。
当前的工作流过于简单, 缺少发布相关的东西。
我希望你参考我的其他项目比如 https://github.com/wysaid/CameraCapture 来设计一下关于发布的工作流。本项目已经内置了一个用于编译打包的工作流, 也可以参考。

  1. 新的工作流应该支持通过 v${a}.${b}.${c} 形式的 tag 触发, 其中 a,b,c 是纯数字(版本号).
  2. 新的工作流触发之后, 跟项目内的实际版本号是否匹配, 如果不匹配则报错。
  3. 如果都满足,那么进行发布流程, 发布的产物应该包含 README.md 里面提到的四种形式的制品。 另外也包含一个打包好的安卓的 apk 文件。这个 apk 文件使用默认的制品(带ffmpeg的版本)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link

coderabbitai bot commented Dec 8, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 5 commits December 8, 2025 14:18
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance workflow to include tag-based release process Add tag-based release workflow with version validation Dec 8, 2025
Copilot AI requested a review from wysaid December 8, 2025 14:29
@wysaid wysaid marked this pull request as ready for review December 8, 2025 14:38
Copilot AI review requested due to automatic review settings December 8, 2025 14:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an automated release workflow triggered by version tags (e.g., v3.1.1) that validates tag-project version consistency, builds all release artifacts, and creates GitHub releases with comprehensive documentation.

  • Adds a GitHub Actions workflow that validates version tags against build.gradle, builds all 4 AAR variants (4KB/16KB × video/image-only) plus a demo APK, and publishes them as GitHub releases
  • Documents the complete release process in README.md with step-by-step instructions for version bumping, tagging, and describes the automated artifact generation
  • Ensures release consistency by failing the build if tag version doesn't match the project's versionName in build.gradle

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/release.yml New automated release workflow with version validation, multi-variant builds (via publish.sh), demo APK generation, and GitHub release creation with release notes
README.md Added "Release Process" section documenting version update workflow, tag creation, automatic validation behavior, and artifact descriptions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Generate release notes
id: release_notes
run: |
cat > /tmp/release_notes.md << 'EOF'
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heredoc delimiter should not use quotes (EOF instead of 'EOF') to allow GitHub Actions expressions to be interpolated. With single quotes, the ${{ }} expressions in the release notes will be written literally instead of being replaced with actual values.

Change line 149 to:

cat > /tmp/release_notes.md << EOF

This will ensure variables like ${{ steps.tag_version.outputs.tag_name }} and ${{ steps.tag_version.outputs.version }} are properly substituted throughout the release notes.

Suggested change
cat > /tmp/release_notes.md << 'EOF'
cat > /tmp/release_notes.md << EOF

Copilot uses AI. Check for mistakes.
./tasks.sh --enable-cmake --release --enable-video-module --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)
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The find command has incorrect operator precedence for the -o (OR) operator. Without parentheses, this searches for *-release.apk in the specified directory OR *-release-unsigned.apk anywhere in the filesystem.

Change to:

APK_PATH=$(find "cgeDemo/build/outputs/apk/release" \( -name "*-release.apk" -o -name "*-release-unsigned.apk" \) | head -1)

This ensures both name patterns are applied within the same directory search.

Suggested change
APK_PATH=$(find "cgeDemo/build/outputs/apk/release" -name "*-release.apk" -o -name "*-release-unsigned.apk" | head -1)
APK_PATH=$(find "cgeDemo/build/outputs/apk/release" \( -name "*-release.apk" -o -name "*-release-unsigned.apk" \) | head -1)

Copilot uses AI. Check for mistakes.

echo "✅ All artifacts built successfully"
echo "📦 Generated artifacts:"
find /tmp/maven-repo -type f -name "*.aar" -o -name "*.pom" | sort
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The find command has incorrect operator precedence. Without parentheses, -o causes the second condition to search globally instead of within the specified directory.

Change to:

find /tmp/maven-repo -type f \( -name "*.aar" -o -name "*.pom" \) | sort

This ensures both name patterns are applied to files within /tmp/maven-repo.

Suggested change
find /tmp/maven-repo -type f -name "*.aar" -o -name "*.pom" | sort
find /tmp/maven-repo -type f \( -name "*.aar" -o -name "*.pom" \) | sort

Copilot uses AI. Check for mistakes.
echo " ✓ Packaged: $filename"
fi
done < <(find "$MAVEN_REPO/org/wysaid/gpuimage-plus" -name "*.aar")

Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding validation to ensure exactly 4 AAR files are packaged. This would catch build failures earlier and make the workflow more robust.

Add after line 140:

# 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
Suggested change
# 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

Copilot uses AI. Check for mistakes.
Fixes:
- Fix find command operator precedence with proper parentheses
- Fix heredoc delimiter to allow variable interpolation
- Add --disable-16kb-page-size flag to demo APK build
- Add validation for exactly 4 AAR files

Features:
- Add workflow_dispatch trigger for manual builds
- Manual builds upload artifacts instead of creating releases
- Differentiate manual vs tag-triggered builds in logs and summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants