Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/android-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
description: Upload the AAR to maven staging repository
required: false
type: boolean
schedule:
- cron: 0 10 * * *

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -26,6 +28,10 @@ jobs:
shell: bash
run: |
VERSION="${{ inputs.version }}"
if [ -z "$VERSION" ]; then
echo "No version name specified. Will create a snapshot AAR"
exit 0
fi
if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar" | grep "200 OK"; then
echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar"
echo "Will skip build/upload"
Expand Down Expand Up @@ -107,6 +113,8 @@ jobs:
pip install awscli==1.32.18
AWS_CMD="aws s3 cp"
VERSION="${{ inputs.version }}"
VERSION_NAME="${VERSION:-temp_snapshot}"
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar --acl public-read
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar.sha256sums --acl public-read
if [ -z "$VERSION" ]; then
VERSION="snapshot-$(date +"%Y%m%d")"
Copy link
Preview

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

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

The handling of a missing version in the upload step differs from the earlier build step. Aligning both checks (either by assigning a snapshot version or exiting early consistently) will avoid potential confusion or unexpected workflow behavior.

Suggested change
VERSION="snapshot-$(date +"%Y%m%d")"
echo "No version name specified. Exiting upload step."
exit 1

Copilot uses AI. Check for mistakes.

fi
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}/executorch.aar --acl public-read
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}/executorch.aar.sha256sums --acl public-read
Loading