From f6227c0801800dae57557314474df5478d330069 Mon Sep 17 00:00:00 2001 From: Dante291 Date: Fri, 1 Dec 2023 00:07:05 +0530 Subject: [PATCH] CI/CD --- .github/workflows/ios_build.yml | 80 +++++++++++++++------------------ 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ios_build.yml b/.github/workflows/ios_build.yml index 0566303..4bfe12e 100644 --- a/.github/workflows/ios_build.yml +++ b/.github/workflows/ios_build.yml @@ -6,59 +6,51 @@ on: - main jobs: - build: + build-ios: + name: Build iOS app runs-on: macos-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: 'stable' + - uses: actions/checkout@v2 - - name: Install Dependencies - run: flutter pub get + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' # Use a supported Java distribution + java-version: '12.0' - - name: Build iOS App - run: flutter build ios --release --no-codesign + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.16.0' + channel: 'stable' # Can be 'beta', 'dev', or 'master' - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: ios-build - path: build/ios/iphoneos/Runner.app + - name: Install dependencies + run: flutter pub get - release: - needs: build - runs-on: ubuntu-latest + - name: Build iOS app + run: flutter build ios --release --no-codesign + # '--no-codesign' is used for building without code signing. + # For actual distribution, proper code signing is required. - steps: - - name: Download Artifact - uses: actions/download-artifact@v2 - with: - name: ios-build - path: build/ios + ######################################################## + ## Package the app as an .ipa and create a release ## + ######################################################## - - name: Create Release - id: create_release - uses: actions/create-release@v1 - with: - tag_name: ${{ github.run_number }} - release_name: Release ${{ github.run_number }} - draft: false - prerelease: false + - name: Package .ipa file + run: | + mkdir Payload + cp -r build/ios/iphoneos/Runner.app Payload/Runner.app + zip -r app.ipa Payload + # This packages the Runner.app into an .ipa file - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/ios/iphoneos/Runner.app.zip - asset_name: ios-app.zip - asset_content_type: application/zip - token: ${{ secrets.MY_GITHUB_TOKEN }} + - uses: ncipollo/release-action@v1 + with: + name: "Automated iOS Release" + artifacts: "app.ipa" + allowUpdates: "true" + generateReleaseNotes: false + tag: "automated" + body: | + This is an automated release, triggered by a recent push. + This may or may not be stable, so please have a look at the stable release(s). Android-Build-and-Release: