diff --git a/.github/workflows/build-and-submit-prod.yml b/.github/workflows/build-and-submit-prod.yml new file mode 100644 index 0000000..616680d --- /dev/null +++ b/.github/workflows/build-and-submit-prod.yml @@ -0,0 +1,27 @@ +# name: Build & Submit Production + +# on: +# pull_request: +# branches: [main] +# paths-ignore: ["docs/**"] +# types: [opened, synchronize] +# # Only run if PR is from `dev` branch +# if: github.head_ref == 'dev' + +# jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 18 + +# - run: npm install -g eas-cli +# - run: eas login --token ${{ secrets.EAS_TOKEN }} + +# - run: eas build --platform android --profile production --non-interactive --no-wait +# - run: eas build --platform ios --profile production --non-interactive --no-wait + +# - run: eas submit --platform android --profile production --non-interactive +# - run: eas submit --platform ios --profile production --non-interactive diff --git a/.github/workflows/ota-publish.yml b/.github/workflows/ota-publish.yml new file mode 100644 index 0000000..7f91603 --- /dev/null +++ b/.github/workflows/ota-publish.yml @@ -0,0 +1,23 @@ +# name: OTA Publish to Production + +# on: +# pull_request: +# branches: [main] +# types: [opened, synchronize] +# # Only if PR is from `ota/*` +# if: startsWith(github.head_ref, 'ota/') + +# jobs: +# publish-ota: +# runs-on: ubuntu-latest + +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 18 + +# - run: npm install -g eas-cli +# - run: eas login --token ${{ secrets.EAS_TOKEN }} + +# - run: eas update --channel production --platform android --non-interactive diff --git a/.github/workflows/preview-android-feature.yml b/.github/workflows/preview-android-feature.yml new file mode 100644 index 0000000..216b19f --- /dev/null +++ b/.github/workflows/preview-android-feature.yml @@ -0,0 +1,46 @@ +name: Preview Android Build (Feature Branch) + +on: + push: + branches: + - "**" + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: yarn + + + - name: 🏗 Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + + - name: 📦 Install dependencies + run: yarn install + + + - name: Trigger EAS Android build (preview) + id: eas_build + run: | + eas build --platform android --profile preview --non-interactive --json > build.json + BUILD_URL=$(cat build.json | jq -r '.[0].artifacts.buildUrl') + echo "BUILD_URL=$BUILD_URL" >> $GITHUB_ENV + + - name: Post PR comment with preview link + if: github.event_name == 'pull_request' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr comment "$PR_URL" --body "🚀 Preview APK is ready! [Download here]($BUILD_URL)" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + BUILD_URL: ${{ env.BUILD_URL }} \ No newline at end of file diff --git a/eas.json b/eas.json index a27779f..68fc01c 100644 --- a/eas.json +++ b/eas.json @@ -10,6 +10,41 @@ "resourceClass": "m-medium" }, "channel": "development" + }, + "preview": { + "distribution": "internal", + "channel": "staging", + "ios": { + "resourceClass": "m-medium" + } + }, + "production": { + "channel": "production", + "ios": { + "resourceClass": "m-medium" + } + } + }, + "submit": { + "preview": { + "ios": { + "appleId": "infinitymichael7@gmail.com", + "ascAppId": "", + "appleTeamId": "" + }, + "android": { + "track": "internal" + } + }, + "production": { + "ios": { + "appleId": "infinitymichael7@gmail.com", + "ascAppId": "", + "appleTeamId": "" + }, + "android": { + "track": "production" + } } } } \ No newline at end of file