diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 00000000..f047a5c9 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,145 @@ +name: Build and distribute + +on: + push: + branches: + - pre_main_qa + +jobs: + build-apk: + name: Build-apk + runs-on: ubuntu-latest + steps: + - name: Checkout code with submodules + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + + - name: Set Version Code + run: | + echo "Received Number: ${{ github.run_number }}" + echo "VERSION_CODE=${{ github.run_number }}" >> $GITHUB_ENV + echo "Set VERSION_CODE to: ${{ github.run_number }}" + shell: bash + + - uses: sheenhx/action-flutter-build-android@v3 + with: + keystore-base64: ${{ secrets.ANDROID_RELEASE_KEY }} + keystore-password: "${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}" + build-cmd: flutter build apk --flavor product --release --build-number=${{ env.VERSION_CODE }} + working-directory: ./ + + - name: Rename APK + run: mv build/app/outputs/flutter-apk/app-product-release.apk build/app/outputs/flutter-apk/moonchain.apk + + - name: Archive APK + uses: actions/upload-artifact@v4 + with: + name: release-apk + # Try running the build locally with the build command to be sure of this path + path: build/app/outputs/flutter-apk/moonchain.apk + + - uses: ryand56/r2-upload-action@latest + with: + r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} + r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + r2-bucket: ${{ secrets.R2_BUCKET }} + source-dir: build/app/outputs/flutter-apk + destination-dir: app + + + build-macos: + name: Build-ios + runs-on: macos-latest + steps: + - name: Checkout code with submodules + uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: sheenhx/action-flutter-build-ios@v1 + with: + # always use --export-options-plist=ios/GithubActionsExportOptions.plist + build-cmd: flutter build ipa --build-number=$(( 15 + ${{ github.run_number }})) --export-options-plist=ios/GithubActionsExportOptions.plist + certificate-base64: ${{ secrets.IOS_BUILD_CERTIFICATE_BASE64 }} + certificate-password: ${{ secrets.IOS_BUILD_CERTIFICATE_PASSWORD }} + provisioning-profile-base64: ${{ secrets.IOS_MOBILE_PROVISIONING_PROFILE_BASE64 }} + keychain-password: ${{ secrets.IOS_GITHUB_KEYCHAIN_PASSWORD }} + + - name: Archive IPA + uses: actions/upload-artifact@v4 + with: + name: release-ipa + # Try running the build locally with the build command to be sure of this path + path: build/ios/ipa/*.ipa + + upload-combined: + name: Combine and Upload Builds + needs: [build-apk, build-macos] + runs-on: ubuntu-latest + steps: + - name: Download Ubuntu artifact + uses: actions/download-artifact@v4 + with: + name: release-apk + path: combined-builds/android + + - name: Download macOS artifact + uses: actions/download-artifact@v4 + with: + name: release-ipa + path: combined-builds/iOS + + - name: Upload combined artifacts + uses: actions/upload-artifact@v4 + with: + name: combined-builds + path: combined-builds + + - name: Generate + id: generate + uses: AcmeSoftwareLLC/app-build-number@v1 + with: + timezone: Asia/Kathmandu + + - name: Display the generated build number + run: echo "Build Number > ${{ steps.generate.outputs.build-number }}" + + + - uses: ncipollo/release-action@v1 + with: + artifacts: "combined-builds/android/*.apk,combined-builds/iOS/*.ipa" + token: ${{ secrets.DART_TOKEN }} + tag: ${{ steps.generate.outputs.build-number }} + + + - name: Upload APK to Waldo + uses: waldoapp/gh-action-upload@v2 + with: + build_path: combined-builds/android/moonchain.apk + upload_token: ${{ secrets.WALDO_SESSIONS_ANDROID }} + + build-waldo: + name: Build-waldo + runs-on: macos-latest + steps: + - name: Checkout code with submodules + uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: sheenhx/action-flutter-build-ios@v1 + with: + # always use --export-options-plist=ios/GithubActionsExportOptions.plist + build-cmd: flutter build ios --simulator + certificate-base64: ${{ secrets.IOS_BUILD_CERTIFICATE_BASE64 }} + certificate-password: ${{ secrets.IOS_BUILD_CERTIFICATE_PASSWORD }} + provisioning-profile-base64: ${{ secrets.IOS_MOBILE_PROVISIONING_PROFILE_BASE64 }} + keychain-password: ${{ secrets.IOS_GITHUB_KEYCHAIN_PASSWORD }} + - name: Upload IPA to Waldo + uses: waldoapp/gh-action-upload@v2 + with: + build_path: build/ios/iphonesimulator/Runner.app + upload_token: ${{ secrets.WALDO_SESSIONS_IOS }} diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml deleted file mode 100644 index c49dbed0..00000000 --- a/.github/workflows/test-action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: GPTReviewWorkflow - -on: - pull_request: - types: - - opened - - synchronize - -jobs: - review_with_gpt: - runs-on: ubuntu-latest - - steps: - - name: GPTReviewWorkflow - uses: sheenhx/GPT4ReviewWorkflow@chunk - with: - GIT_COMMIT_HASH: ${{ github.event.pull_request.head.sha }} - GIT_PATCH_OUTPUT: ${{ github.event.pull_request.patch_url }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - OPENAI_ORG_KEY: ${{ secrets.OPENAI_ORG_KEY }} - PR_NUMBER: ${{ github.event.pull_request.number }} - PR_TITLE: ${{ github.event.pull_request.title }} - REPOSITORY_NAME: ${{ github.repository }} diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index c778cee3..022e1a36 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -1,24 +1,46 @@ -name: Translate +name: Translate en.json to de.json on: push: - branches: [ main ] - pull_request: - branches: [ main ] + branches: + - pre_main_qa + paths: + - 'assets/flutter_i18n/en.json' + workflow_dispatch: jobs: translate: runs-on: ubuntu-latest + permissions: + contents: write steps: - - name: translate - uses: sheenhx/translatei18n - with: - GIT_COMMIT_HASH: ${{ github.event.pull_request.head.sha }} - GIT_PATCH_OUTPUT: ${{ github.event.pull_request.patch_url }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - OPENAI_ORG_KEY: ${{ secrets.OPENAI_ORG_KEY }} - PR_NUMBER: ${{ github.event.pull_request.number }} - PR_TITLE: ${{ github.event.pull_request.title }} - REPOSITORY_NAME: ${{ github.repository }} + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12.3' # Specify Python version + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -q -U google-generativeai + + - name: Run translation script + working-directory: translations + env: + GEMINI_API_KEY: ${{ secrets.GEMINIKEY }} + run: | + python translate.py + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Update pre-QA with latest translations" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 344ea755..d6faaa5f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# AXS Wallet +# Moonchain Wallet -AXS wallet using an ERC-20 smart contract. +Self custodial Moonchain wallet, Seamless interaction with MXC chains & EVM based chains, Enabling users to Send/Receive tokens, NFTs, and interact with Web3 DApps. ## Project Structure @@ -30,7 +30,7 @@ And also, UseCases are feature-level, while presenters are widget-level. So 1 pr ## Shared Library -This library includes AXS wallet's UI(User Interface) and business logic. The basic components and images, fonts, colors come from defination of designer's Figma. The logic part is to call the related APIs. +This library includes Moonchain wallet's UI(User Interface) and business logic. The basic components and images, fonts, colors come from defination of designer's Figma. The logic part is to call the related APIs. The repository: https://github.com/MXCzkEVM/mxc-shared-flutter @@ -75,7 +75,7 @@ When you want to debug on your local computer, suggest to create .vscode/launch. "version": "0.2.0", "configurations": [ { - "name": "axs-wallet", + "name": "moonchain-wallet", "request": "launch", "type": "dart", "args": [ diff --git a/android/app/build.gradle b/android/app/build.gradle index 04754268..a2c29632 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -5,6 +5,12 @@ if (localPropertiesFile.exists()) { localProperties.load(reader) } } +// Load key.properties +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file("key.properties") +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { @@ -23,7 +29,7 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' // START: FlutterFire Configuration -apply plugin: 'com.google.gms.google-services' +// apply plugin: 'com.google.gms.google-services' // END: FlutterFire Configuration apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" @@ -50,31 +56,34 @@ android { } defaultConfig { - applicationId "com.mxc.axswallet" + applicationId "com.mxc.moonchainWallet" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 21 targetSdkVersion 34 - versionCode System.getenv('APPCENTER_BUILD_ID')?.toInteger() ?: 404 + versionCode System.getenv('VERSION_CODE')?.hashCode()?.abs() ?: 404 versionName flutterVersionName } signingConfigs { release { - storeFile rootProject.file("app/key.jks") - storePassword System.getenv("APPCENTER_KEYSTORE_PASSWORD") - keyAlias System.getenv("APPCENTER_KEY_ALIAS") - keyPassword System.getenv("APPCENTER_KEY_PASSWORD") + keyAlias = keystoreProperties['keyAlias'] + keyPassword = keystoreProperties['keyPassword'] + storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword = keystoreProperties['storePassword'] } } buildTypes { release { - signingConfig signingConfigs.release + // Enables code shrinking, obfuscation, and optimization minifyEnabled true + // Enables resource shrinking shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + // Specify ProGuard rules files + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.release } debug { signingConfig signingConfigs.debug diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 30e32fa0..35da0ec0 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.mxc.moonchainWallet">