diff --git a/.github/workflows/android-release-artifacts.yml b/.github/workflows/android-release-artifacts.yml index 2503bf2214b..dcf6553d257 100644 --- a/.github/workflows/android-release-artifacts.yml +++ b/.github/workflows/android-release-artifacts.yml @@ -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 }} @@ -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" @@ -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")" + 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