From 8e36714dd6203b427b98a54e9f6efe6575c9a785 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Thu, 2 May 2024 20:41:28 -0400 Subject: [PATCH] update IOS action --- .../workflows/{build_apk.yml => build.yml} | 34 +++++++++++++++++++ .github/workflows/build_ios.yml | 24 ------------- Scripts/build.sh | 12 +++++-- 3 files changed, 44 insertions(+), 26 deletions(-) rename .github/workflows/{build_apk.yml => build.yml} (76%) delete mode 100644 .github/workflows/build_ios.yml diff --git a/.github/workflows/build_apk.yml b/.github/workflows/build.yml similarity index 76% rename from .github/workflows/build_apk.yml rename to .github/workflows/build.yml index c8e5249f..ae61b3be 100644 --- a/.github/workflows/build_apk.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,40 @@ jobs: SENTRY_URL: ${{ secrets.SENTRY_URL }} SENTRY_RELEASE: ${{ steps.build.outputs.SENTRY_RELEASE }} SENTRY_DIST: ${{ steps.build.outputs.SENTRY_DIST }} + build_ios: + name: Build IOS Artifact + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.19.2' + cache: true + - name: Run build script + id: build + run: bash ${GITHUB_WORKSPACE}/Scripts/build.sh + working-directory: Scripts + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + GITHUB_EVENT_NAME: ${{ github.event_name }} + IOS: true + - uses: actions/upload-artifact@v4 + with: + path: | + build/ios/archive/ + - name: Upload debug symbols + run: flutter packages pub run sentry_dart_plugin + if: github.event_name == 'push' || github.event_name == 'release' + continue-on-error: true + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + SENTRY_URL: ${{ secrets.SENTRY_URL }} + SENTRY_RELEASE: ${{ steps.build.outputs.SENTRY_RELEASE }} + SENTRY_DIST: ${{ steps.build.outputs.SENTRY_DIST }} release-job: name: Releasing needs: build_android diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml deleted file mode 100644 index e0fd776f..00000000 --- a/.github/workflows/build_ios.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - workflow_dispatch: - -jobs: - build_ios: - name: Build IOS Artifact - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@v1 - - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.19.2' - - name: Install packages - run: flutter pub get - - name: Generate localizations - run: flutter gen-l10n - - name: Generate configs - run: dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb && flutter pub run build_runner build --delete-conflicting-outputs - - name: Build app - run: flutter build ipa --release --no-codesign - - name: Upload debug symbols - run: flutter packages pub run sentry_dart_plugin - diff --git a/Scripts/build.sh b/Scripts/build.sh index 5487015e..f9d0597a 100644 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -19,12 +19,20 @@ flutter gen-l10n DEBUG="" if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then DEBUG="--debug" +else + DEBUG="--release" fi dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb flutter pub run build_runner build --delete-conflicting-outputs if [[ ! -v SKIP_BUILD ]]; then - flutter build apk --split-debug-info=./symbols $DEBUG --build-number="$BUILD_NUMBER" --build-name="$VERSION" - flutter build appbundle --split-debug-info=./symbols --build-number="$BUILD_NUMBER" --build-name="$VERSION" + + if [[ -v IOS ]]; then + flutter build ipa $DEBUG--no-codesign --build-number="$BUILD_NUMBER" --build-name="$VERSION" + else + flutter build apk --split-debug-info=./symbols $DEBUG --build-number="$BUILD_NUMBER" --build-name="$VERSION" + flutter build appbundle --split-debug-info=./symbols --build-number="$BUILD_NUMBER" --build-name="$VERSION" + fi + if [[ -v GITHUB_OUTPUT ]]; then echo "SENTRY_DIST=$BUILD_NUMBER" >> "$GITHUB_OUTPUT" echo "SENTRY_RELEASE=$VERSION" >> "$GITHUB_OUTPUT"