release(ios): 1.0.46 #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release iOS | |
| on: | |
| push: | |
| tags: | |
| - "v-ios-*" | |
| concurrency: | |
| group: release-ios-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-submit-ios: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| permissions: | |
| contents: read | |
| env: | |
| EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
| EXPO_PROJECT_ID: ${{ secrets.EXPO_PROJECT_ID }} | |
| ASC_APP_ID: ${{ secrets.ASC_APP_ID }} | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Setup Expo and EAS | |
| uses: expo/expo-github-action@v8 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: Verify Expo auth | |
| run: eas whoami | |
| - name: Generate build metadata file | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p src | |
| cat > src/build-meta.js <<EOF | |
| export const buildMeta = { | |
| gitCommitHash: "${GITHUB_SHA::7}", | |
| gitTag: "${GITHUB_REF_NAME}", | |
| workflowUrl: "https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}", | |
| }; | |
| EOF | |
| echo "Generated src/build-meta.js" | |
| cat src/build-meta.js | |
| - name: Commit generated build meta | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git add src/build-meta.js | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "build(ci): inject build metadata" | |
| fi | |
| - name: Build iOS | |
| id: build_ios | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| BUILD_OUTPUT=$(eas build \ | |
| --platform ios \ | |
| --profile production \ | |
| --non-interactive \ | |
| --wait \ | |
| --json) | |
| BUILD_ID=$(printf '%s' "$BUILD_OUTPUT" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const raw=JSON.parse(d);const build=Array.isArray(raw)?raw[0]:raw;if(!build||!build.id){console.error('Build ID not found in EAS output');process.exit(1)}process.stdout.write(build.id)})") | |
| echo "build_id=${BUILD_ID}" >> "$GITHUB_OUTPUT" | |
| echo "BUILD_ID=${BUILD_ID}" >> "$GITHUB_ENV" | |
| echo "Build ID: ${BUILD_ID}" | |
| - name: Backup eas.json | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cp eas.json eas.json.backup | |
| - name: Create temporary eas.json for submit | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cat > eas.json <<EOF | |
| { | |
| "cli": { | |
| "version": ">= 18.4.0", | |
| "appVersionSource": "remote", | |
| "requireCommit": true | |
| }, | |
| "submit": { | |
| "production": { | |
| "ios": { | |
| "ascAppId": "${ASC_APP_ID}" | |
| } | |
| } | |
| } | |
| } | |
| EOF | |
| - name: Submit iOS to App Store Connect | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| eas submit \ | |
| --platform ios \ | |
| --profile production \ | |
| --non-interactive \ | |
| --id "$BUILD_ID" | |
| - name: Restore eas.json | |
| if: always() | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [ -f eas.json.backup ]; then | |
| mv eas.json.backup eas.json | |
| fi |