Skip to content

Commit 9c918bf

Browse files
Use flavor-specific artifact names to avoid S3 upload collision
When android-release-on-tag calls this workflow for multiple flavors, they share the same run_id and S3 prefix. Naming the intermediate artifact executorch-${FLAVOR}.aar prevents the second and third uploads from failing with "file already exists".
1 parent b1eae74 commit 9c918bf

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/android-release-artifacts.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ jobs:
145145
export BUILD_AAR_DIR=aar-out
146146
bash scripts/build_android_library.sh
147147
mkdir -p "${ARTIFACTS_DIR_NAME}"
148-
cp aar-out/executorch.aar "${ARTIFACTS_DIR_NAME}/executorch.aar"
148+
cp aar-out/executorch.aar "${ARTIFACTS_DIR_NAME}/executorch-${FLAVOR}.aar"
149149
150-
shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
150+
shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch-${FLAVOR}.aar"
151151
152152
# Publish to maven staging
153153
UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
@@ -172,11 +172,6 @@ jobs:
172172
- name: Upload AAR RC to AWS S3
173173
shell: bash
174174
run: |
175-
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/executorch.aar
176-
shasum -a 256 executorch.aar > executorch.aar.sha256sums
177-
178-
pip install awscli==1.32.18
179-
AWS_CMD="aws s3 cp"
180175
VERSION="${{ inputs.version }}"
181176
FLAVOR="${{ inputs.flavor }}"
182177
if [ -z "$VERSION" ]; then
@@ -185,5 +180,11 @@ jobs:
185180
if [ -z "$FLAVOR" ]; then
186181
FLAVOR="xnnpack"
187182
fi
183+
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/executorch-${FLAVOR}.aar
184+
mv executorch-${FLAVOR}.aar executorch.aar
185+
shasum -a 256 executorch.aar > executorch.aar.sha256sums
186+
187+
pip install awscli==1.32.18
188+
AWS_CMD="aws s3 cp"
188189
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}-${FLAVOR}/executorch.aar --acl public-read
189190
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}-${FLAVOR}/executorch.aar.sha256sums --acl public-read

0 commit comments

Comments
 (0)