-
Notifications
You must be signed in to change notification settings - Fork 2
feat: workflow to build an ordinary apk #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe project has undergone significant updates to streamline build processes and enhance documentation practices. Changes include optimizing cleaning tasks in the Android build configuration, updating iOS platform versions for compatibility, and introducing a Changelog section following best practices. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (2)
- .github/workflows/basic_checks.yaml (1 hunks)
- CHANGELOG.md (1 hunks)
Files skipped from review due to trivial changes (1)
- CHANGELOG.md
Additional comments: 2
.github/workflows/basic_checks.yaml (2)
- 90-92: The
setup-javaaction is configured to use Zulu's distribution of Java 11. Ensure that this Java version is compatible with all the tools and SDKs used in the build process, especially for Flutter projects targeting Android.- 100-103: The command
flutter build apkis used to start the release build. Ensure that all necessary configurations, such as signing the APK for release, are properly set up in the Flutter project to avoid build failures or unsigned APKs.
| build: | ||
| name: Create Android Build | ||
| needs: version | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - uses: actions/setup-java@v3 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: "11.x" | ||
|
|
||
| - uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: 'stable' | ||
| flutter-version: $FLUTTER_VERSION | ||
|
|
||
| - name: Get dependencies | ||
| run: flutter pub get | ||
|
|
||
| - name: Start release build | ||
| run: flutter build apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build job specifies needs: version, but there is no version job defined in this workflow. This will cause the workflow to fail because it depends on a non-existent job.
- needs: version
+ # needs: versionConsider removing or correcting the needs attribute to reference an existing job if the dependency was intended.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| build: | |
| name: Create Android Build | |
| needs: version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: "11.x" | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| flutter-version: $FLUTTER_VERSION | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Start release build | |
| run: flutter build apk | |
| build: | |
| name: Create Android Build | |
| # needs: version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: "11.x" | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| flutter-version: $FLUTTER_VERSION | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Start release build | |
| run: flutter build apk |
.github/workflows/basic_checks.yaml
Outdated
| - uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: 'stable' | ||
| flutter-version: $FLUTTER_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subosito/flutter-action@v2 is used here instead of flutter-actions/[email protected] which is used in other jobs for setting up Flutter. Ensure consistency across the workflow to avoid potential issues with different versions or setups of Flutter.
- - uses: subosito/flutter-action@v2
+ - uses: flutter-actions/[email protected]Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| flutter-version: $FLUTTER_VERSION | |
| - uses: flutter-actions/setup-flutter@v2.2 | |
| with: | |
| channel: 'stable' | |
| flutter-version: $FLUTTER_VERSION |
…[email protected]' in basic_checks.yaml
changed 'sdk: '>=2.19.6 <3.0.0' to 'sdk: '>=2.19.6 <4.0.0' in pubspec.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
pubspec.yamlis excluded by:!**/*.yaml
Files selected for processing (1)
- .github/workflows/basic_checks.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/basic_checks.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (4)
analysis_options.yamlis excluded by:!**/*.yamlios/Podfile.lockis excluded by:!**/*.lockpubspec.lockis excluded by:!**/*.lockpubspec.yamlis excluded by:!**/*.yaml
Files selected for processing (5)
- android/build.gradle (1 hunks)
- ios/Flutter/AppFrameworkInfo.plist (1 hunks)
- ios/Podfile (1 hunks)
- ios/Runner.xcodeproj/project.pbxproj (4 hunks)
- ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (1 hunks)
Files skipped from review due to trivial changes (1)
- ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Additional comments: 5
android/build.gradle (1)
- 29-29: The task declaration change from
task clean(type: Delete)totasks.register("clean", Delete)is a best practice in Gradle to define tasks lazily, improving the configuration time of the build. This change is correct and aligns with Gradle's recommended practices.ios/Flutter/AppFrameworkInfo.plist (1)
- 24-24: Updating
MinimumOSVersionfrom11.0to12.0inAppFrameworkInfo.plistcorrectly raises the minimum iOS version requirement. Ensure that all features used in the app are compatible with iOS 12.0 and above.ios/Runner.xcodeproj/project.pbxproj (3)
- 346-346: Updating
IPHONEOS_DEPLOYMENT_TARGETto12.0in the Profile configuration is correct and aligns with the update inAppFrameworkInfo.plistand the intended Podfile change.- 424-424: Updating
IPHONEOS_DEPLOYMENT_TARGETto12.0in the Debug configuration is correct and ensures consistency across build configurations.- 473-473: Updating
IPHONEOS_DEPLOYMENT_TARGETto12.0in the Release configuration is correct, ensuring that the deployment target is consistent across all configurations.
| @@ -1,5 +1,5 @@ | |||
| # Uncomment this line to define a global platform for your project | |||
| # platform :ios, '11.0' | |||
| # platform :ios, '12.0' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting out platform :ios, '12.0' updates the iOS platform version from 11.0 to 12.0. This change is commented out and should be uncommented to take effect. Ensure compatibility with iOS 12.0 for all dependencies.
- # platform :ios, '12.0'
+ platform :ios, '12.0'Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| # platform :ios, '12.0' | |
| platform :ios, '12.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- .github/workflows/basic_checks.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/basic_checks.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| - name: Run unit test | ||
| run: flutter test | ||
| run: flutter test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache key in the unit-tests job uses package-lock.json, which is not generated by Flutter projects. Flutter projects use pubspec.lock for dependency locking. This should be corrected to ensure that the caching mechanism works as intended.
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }}Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| run: flutter test | |
| run: flutter test |
| - uses: actions/setup-java@v3 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: "11.x" | ||
|
|
||
| - uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: 'stable' | ||
| flutter-version: '3.16.8' | ||
|
|
||
| - name: Show Flutter Version | ||
| run: flutter --version | ||
|
|
||
| - name: Get dependencies | ||
| run: flutter pub get | ||
|
|
||
| - name: Start release build | ||
| run: flutter build apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build job uses subosito/flutter-action@v2 for setting up Flutter, which is different from the flutter-actions/[email protected] used in the lint and unit-tests jobs. While both actions serve the same purpose, it's generally a good practice to maintain consistency across the workflow to avoid confusion and ensure that all jobs use the same version of Flutter. Consider aligning the Flutter setup action across all jobs.
- uses: subosito/flutter-action@v2
+ uses: flutter-actions/[email protected]Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: "11.x" | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| flutter-version: '3.16.8' | |
| - name: Show Flutter Version | |
| run: flutter --version | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Start release build | |
| run: flutter build apk | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: "11.x" | |
| - uses: flutter-actions/setup-flutter@v2.2 | |
| with: | |
| channel: 'stable' | |
| flutter-version: '3.16.8' | |
| - name: Show Flutter Version | |
| run: flutter --version | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Start release build | |
| run: flutter build apk |
Here is a workflow to build an ordinary apk file using github action.
It is expected that this will build an apk file once the pr is made.
The main resources that was used to build this aspect can be found here
Summary by CodeRabbit