diff --git a/.github/workflows/build-ipa.yml b/.github/workflows/build-ipa.yml new file mode 100644 index 0000000..ecb5f11 --- /dev/null +++ b/.github/workflows/build-ipa.yml @@ -0,0 +1,78 @@ +name: Build IPA + +on: + workflow_dispatch: + push: + tags: + - 'ipa-v*.*.*' + - 'v*.*.*' + paths-ignore: + - 'README.md' + - 'wiki/**' + - 'public/**' + - 'scripts/**' + - '.vscode' + - '.idea' + pull_request: + branches: + - master + - main + paths-ignore: + - 'README.md' + - 'wiki/**' + - 'public/**' + - '.scripts/**' + - '.vscode' + - '.idea' + +jobs: + build: + name: Install and build + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 9 + - uses: actions/setup-node@v3 + with: + node-version: 22.x + cache: pnpm + + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Build tw plugins & scripts + run: | + cd plugins && pnpm i && cd .. + pnpm run build:plugin + pnpm run build:preload + + - name: Build IPA + run: expo build:ios --non-interactive --no-publish --type archive + - name: Download IPA + run: curl "$(expo url:ipa --non-interactive)" -o app.ipa + + - name: Create Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + generate_release_notes: true + files: app.ipa + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/eas-build.yml b/.github/workflows/eas-build.yml deleted file mode 100644 index e5af83a..0000000 --- a/.github/workflows/eas-build.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: EAS Build - -on: - workflow_dispatch: - push: - tags: - - 'eas-v*.*.*' - - 'v*.*.*' - paths-ignore: - - 'README.md' - - 'wiki/**' - - 'public/**' - - 'scripts/**' - - '.vscode' - - '.idea' - -jobs: - build: - name: Install and build - runs-on: ubuntu-latest - steps: - - name: Check for EXPO_TOKEN - run: | - if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then - echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" - exit 1 - fi - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v3 - with: - node-version: 22.x - cache: pnpm - - - name: Setup Expo and EAS - uses: expo/expo-github-action@v8 - with: - eas-version: latest - token: ${{ secrets.EXPO_TOKEN }} - - name: Install dependencies - run: pnpm install - - name: Build on EAS - run: eas build --profile preview --platform ios --non-interactive diff --git a/eas.json b/eas.json index 8aac611..5f840dc 100644 --- a/eas.json +++ b/eas.json @@ -1,6 +1,7 @@ { "cli": { - "version": ">= 5.1.0" + "version": ">= 13.4.2", + "appVersionSource": "local" }, "build": { "development": { diff --git a/package.json b/package.json index 59c5afa..bd6a138 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build:preload": "zx scripts/buildPreload.mjs", "build:sqlite-migration": "drizzle-kit generate:sqlite", "build:android-apk": "eas build --profile preview --platform android --non-interactive", + "build:ios-ipa": "eas build --profile preview --platform ios", "build:expo-sdk": "eas build --profile development --platform android --non-interactive", "ios": "cross-env NODE_ENV=development expo start --go --ios", "start": "cross-env NODE_ENV=development expo start",