Skip to content

Commit 22707f0

Browse files
huydhnfacebook-github-bot
authored andcommitted
Upload apple ios artifacts (#2449)
Summary: The role `arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-ios` needs to be created by pytorch-labs/pytorch-gha-infra#358 first before this can be landed. Pull Request resolved: #2449 Reviewed By: shoumikhin Differential Revision: D54931355 Pulled By: huydhn fbshipit-source-id: dd49e2ea7f7220377c0b61af9b9049368ac71b04
1 parent 6a704bf commit 22707f0

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

.github/workflows/apple.yml

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request:
99
paths:
1010
- .ci/docker/**
11-
- .github/workflows/app-build.yml
11+
- .github/workflows/apple.yml
1212
- install_requirements.sh
1313
- backends/apple/**
1414
- build/build_apple_frameworks.sh
@@ -58,7 +58,7 @@ jobs:
5858
python-version: '3.11'
5959
submodules: 'true'
6060
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
61-
upload-artifact: executorch.zip
61+
upload-artifact: executorch-frameworks-ios
6262
timeout: 90
6363
script: |
6464
WORKSPACE=$(pwd)
@@ -90,3 +90,50 @@ jobs:
9090
zip -r "${RUNNER_TEMP}/artifacts/${OUTPUT}.zip" "${OUTPUT}"
9191
9292
popd
93+
94+
upload-frameworks-ios:
95+
runs-on: ubuntu-22.04
96+
needs: build-frameworks-ios
97+
timeout-minutes: 30
98+
permissions:
99+
id-token: write
100+
contents: read
101+
steps:
102+
- uses: actions/checkout@v3
103+
- uses: actions/setup-python@v4
104+
with:
105+
python-version: '3.11'
106+
cache: pip
107+
- name: configure aws credentials
108+
uses: aws-actions/[email protected]
109+
with:
110+
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-ios
111+
aws-region: us-east-1
112+
- name: Download the artifact
113+
uses: actions/download-artifact@v3
114+
with:
115+
# NB: The name here needs to match the upload-artifact name from build-frameworks-ios job
116+
name: executorch-frameworks-ios
117+
path: ${{ runner.temp }}/frameworks-ios/
118+
- name: Only push to S3 from main branch
119+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
120+
shell: bash
121+
run: |
122+
set -eux
123+
echo "UPLOAD_ON_MAIN=1" >> "${GITHUB_ENV}"
124+
- name: Upload the artifact to ossci-ios S3 bucket
125+
shell: bash
126+
run: |
127+
set -eux
128+
129+
pip install awscli==1.32.18
130+
131+
AWS_CMD="aws s3 cp --dryrun"
132+
if [[ "${UPLOAD_ON_MAIN:-0}" == "1" ]]; then
133+
AWS_CMD="aws s3 cp"
134+
fi
135+
136+
for FILENAME in "${RUNNER_TEMP}"/frameworks-ios/*.zip; do
137+
[ -e "${FILENAME}" ] || continue
138+
${AWS_CMD} "${FILENAME}" s3://ossci-ios/executorch/ --acl public-read
139+
done

0 commit comments

Comments
 (0)