|
8 | 8 | pull_request:
|
9 | 9 | paths:
|
10 | 10 | - .ci/docker/**
|
11 |
| - - .github/workflows/app-build.yml |
| 11 | + - .github/workflows/apple.yml |
12 | 12 | - install_requirements.sh
|
13 | 13 | - backends/apple/**
|
14 | 14 | - build/build_apple_frameworks.sh
|
|
58 | 58 | python-version: '3.11'
|
59 | 59 | submodules: 'true'
|
60 | 60 | 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 |
62 | 62 | timeout: 90
|
63 | 63 | script: |
|
64 | 64 | WORKSPACE=$(pwd)
|
|
90 | 90 | zip -r "${RUNNER_TEMP}/artifacts/${OUTPUT}.zip" "${OUTPUT}"
|
91 | 91 |
|
92 | 92 | 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