diff --git a/.github/workflows/docs_deploy.yml b/.github/workflows/docs_deploy.yml deleted file mode 100644 index e29709b5..00000000 --- a/.github/workflows/docs_deploy.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build and deploy mkdocs to gh-pages -on: - push: - branches: - - develop - workflow_dispatch: -jobs: - deploy-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - run: pip install mkdocs-material - - run: pip install mkdocs-minify-plugin - - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/.github/workflows/on_cron.yml b/.github/workflows/on_cron.yml new file mode 100644 index 00000000..63d56c44 --- /dev/null +++ b/.github/workflows/on_cron.yml @@ -0,0 +1,62 @@ +name: Nightly build + +on: + schedule: + - cron: "0 0 * * 2-6" # https://crontab.guru/#0_0_*_*_2-6 + workflow_dispatch: + inputs: + version_name: + description: 'Version name (Android)' + required: true + type: string + default: '1.x.x-snapshot' + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + generate_version: + runs-on: ubuntu-latest + outputs: + version_name: ${{ steps.version.outputs.version_name }} + steps: + - name: Generate version name with timestamp + id: version + run: | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + VERSION_NAME="${{ inputs.version_name }}" + echo "[DEBUG] Using manual input version name: $VERSION_NAME" + else + VERSION_NAME="nightly-${{ github.run_id }}" + echo "[DEBUG] Generated automatic version name: $VERSION_NAME" + fi + echo "version_name=$VERSION_NAME" >> $GITHUB_OUTPUT + nightly_build: + needs: generate_version + uses: futuredapp/.github/.github/workflows/kmp-combined-nightly-build.yml@2.0.0 + with: + # `testReleaseUnitTest` covers androidApp module and all shared modules all at once. No need to call `testEnterpriseUnitTest` and `testReleaseUnitTest`. + ANDROID_TEST_GRADLE_TASK: testReleaseUnitTest + ANDROID_PACKAGE_GRADLE_TASK: packageEnterpriseUniversalApk + ANDROID_UPLOAD_GRADLE_TASK: appDistributionUploadEnterprise + ANDROID_VERSION_NAME: ${{ needs.generate_version.outputs.version_name }} + # TODO PROJECT-SETUP verify product flavor configuration + # Specifies API environment for KMP build. + # One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module. + KMP_FLAVOR: 'dev' + KMP_SWIFT_PACKAGE_INTEGRATION: true + KMP_SWIFT_PACKAGE_PATH: 'iosApp/shared/KMP' + # TODO PROJECT-SETUP Verify app distribution groups + FIREBASE_APP_DISTRIBUTION_GROUPS: futured-devs, futured-qa + CHANGELOG_DEBUG: true + CHANGELOG_CHECKOUT_DEPTH: 100 + CHANGELOG_FALLBACK_LOOKBACK: "2 weeks" + secrets: + FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} + # TODO PROJECT-SETUP create random secure string in repository secrets, or leave out to disable configuration cache + GRADLE_CACHE_ENCRYPTION_KEY: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + IOS_MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + IOS_APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} + IOS_APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} + IOS_APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} diff --git a/.github/workflows/on_demand_deploy.yml b/.github/workflows/on_demand_deploy.yml deleted file mode 100644 index d05a20df..00000000 --- a/.github/workflows/on_demand_deploy.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Deploy On-Demand QA Snapshot - -on: - workflow_dispatch: - inputs: - DEPLOY_IOS: - description: 'Deploy iOS app to internal TestFlight' - required: true - type: boolean - default: true - DEPLOY_ANDROID: - description: 'Deploy Android app to Firebase' - required: true - type: boolean - default: true - VERSION_NAME: - description: 'Version name (Android)' - required: true - type: string - default: '1.X.X-snapshot' - APP_DISTRIBUTION_GROUPS: - description: 'App distribution group IDs (Firebase, comma-separated)' - required: true - type: string - default: futured-devs - RELEASE_NOTES: - description: 'Release notes (Firebase)' - required: true - type: string - -jobs: - deploy_ios: - name: Deploy iOS Beta - if: ${{ inputs.DEPLOY_IOS }} - uses: futuredapp/.github/.github/workflows/ios-kmp-selfhosted-build.yml@main - with: - kmp_swift_package_integration: true - kmp_swift_package_path: iosApp/shared/KMP - # TODO PROJECT-SETUP verify product flavor configuration - # Specifies API environment for KMP build. - # One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module. - kmp_swift_package_flavor: dev - secrets: - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} - APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - - deploy_android: - name: Deploy Android to Firebase - if: ${{ inputs.DEPLOY_ANDROID }} - uses: futuredapp/.github/.github/workflows/android-cloud-release-firebaseAppDistribution.yml@main - with: - VERSION_NAME: ${{ inputs.VERSION_NAME }} - TEST_GRADLE_TASKS: testReleaseUnitTest - BUNDLE_GRADLE_TASK: bundleEnterprise - UPLOAD_GRADLE_TASK: appDistributionUploadEnterprise - SIGNING_KEYSTORE_PATH: androidApp/keystore/debug.keystore - APP_DISTRIBUTION_GROUPS: ${{ inputs.APP_DISTRIBUTION_GROUPS }} - # TODO PROJECT-SETUP verify product flavor configuration - # Specifies API environment for KMP build. - # One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module. - KMP_FLAVOR: 'dev' - RELEASE_NOTES: ${{ inputs.RELEASE_NOTES }} - secrets: - # TODO PROJECT-SETUP Set up `APP_DISTRIBUTION_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository - SIGNING_KEYSTORE_PASSWORD: android - SIGNING_KEY_ALIAS: androiddebugkey - SIGNING_KEY_PASSWORD: android - APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} diff --git a/.github/workflows/on_merge_pull_request.yml b/.github/workflows/on_merge_pull_request.yml deleted file mode 100644 index 162cfd54..00000000 --- a/.github/workflows/on_merge_pull_request.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Publish QA snapshot - -on: - push: - branches: - - develop - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - -jobs: - detect-changes: - uses: futuredapp/.github/.github/workflows/kmp-cloud-detect-changes.yml@main - - deploy_ios_beta: - name: Deploy iOS Beta - needs: detect-changes - if: ${{ needs.detect-changes.outputs.iosFiles == 'true' }} - uses: futuredapp/.github/.github/workflows/ios-kmp-selfhosted-build.yml@main - with: - kmp_swift_package_integration: true - kmp_swift_package_path: iosApp/shared/KMP - # TODO PROJECT-SETUP verify product flavor configuration - # Specifies API environment for KMP build. - # One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module. - kmp_swift_package_flavor: dev - secrets: - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} - APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - - deploy_android_enterprise: - name: Deploy Android Enterprise - needs: detect-changes - if: ${{ needs.detect-changes.outputs.androidFiles == 'true' }} - uses: futuredapp/.github/.github/workflows/android-cloud-release-firebaseAppDistribution.yml@main - with: - # `testReleaseUnitTest` covers androidApp module and all shared modules all at once. No need to call `testEnterpriseUnitTest` and `testReleaseUnitTest`. - TEST_GRADLE_TASKS: testReleaseUnitTest - BUNDLE_GRADLE_TASK: bundleEnterprise - UPLOAD_GRADLE_TASK: appDistributionUploadEnterprise - SIGNING_KEYSTORE_PATH: androidApp/keystore/debug.keystore - # TODO PROJECT-SETUP Verify app distribution groups - APP_DISTRIBUTION_GROUPS: futured-devs, futured-qa - # TODO PROJECT-SETUP verify product flavor configuration - # Specifies API environment for KMP build. - # One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module. - KMP_FLAVOR: dev - secrets: - # TODO PROJECT-SETUP Set up `APP_DISTRIBUTION_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository - SIGNING_KEYSTORE_PASSWORD: android - SIGNING_KEY_ALIAS: androiddebugkey - SIGNING_KEY_PASSWORD: android - APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }} diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml index 369258a9..496b7a83 100644 --- a/.github/workflows/on_pull_request.yml +++ b/.github/workflows/on_pull_request.yml @@ -8,12 +8,12 @@ concurrency: jobs: detect-changes: - uses: futuredapp/.github/.github/workflows/kmp-cloud-detect-changes.yml@main + uses: futuredapp/.github/.github/workflows/kmp-cloud-detect-changes.yml@2.0.0 check-android: needs: detect-changes if: ${{ needs.detect-changes.outputs.androidFiles == 'true' }} - uses: futuredapp/.github/.github/workflows/android-cloud-check.yml@main + uses: futuredapp/.github/.github/workflows/android-cloud-check.yml@2.0.0 with: LINT_GRADLE_TASKS: lintCheck # `testReleaseUnitTest` covers androidApp module and all shared modules all at once. No need to call `testEnterpriseUnitTest` and `testReleaseUnitTest`. @@ -22,7 +22,7 @@ jobs: check-ios: needs: detect-changes if: ${{ needs.detect-changes.outputs.iosFiles == 'true' }} - uses: futuredapp/.github/.github/workflows/ios-kmp-selfhosted-test.yml@main + uses: futuredapp/.github/.github/workflows/ios-kmp-selfhosted-test.yml@2.0.0 with: kmp_swift_package_integration: true kmp_swift_package_path: iosApp/shared/KMP diff --git a/.github/workflows/on_release.yml b/.github/workflows/on_release.yml index fa48bf1b..8df38cb8 100644 --- a/.github/workflows/on_release.yml +++ b/.github/workflows/on_release.yml @@ -7,7 +7,7 @@ on: jobs: release_ios: name: iOS Release - uses: futuredapp/.github/.github/workflows/ios-kmp-selfhosted-release.yml@main + uses: futuredapp/.github/.github/workflows/ios-kmp-selfhosted-release.yml@2.0.0 with: kmp_swift_package_integration: true kmp_swift_package_path: iosApp/shared/KMP @@ -23,11 +23,10 @@ jobs: release_android: name: Android Release - uses: futuredapp/.github/.github/workflows/android-cloud-release-googlePlay.yml@main + uses: futuredapp/.github/.github/workflows/android-cloud-release-googlePlay.yml@2.0.0 with: VERSION_NAME: ${{ github.event.release.tag_name }} BUNDLE_GRADLE_TASK: bundleRelease - SIGNING_KEYSTORE_PATH: androidApp/keystore/release.keystore # TODO PROJECT-SETUP This has to be applicationId GOOGLE_PLAY_APPLICATION_ID: app.futured.kmptemplate.android GOOGLE_PLAY_WHATSNEW_DIRECTORY: androidApp/whatsnew diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index c8907f94..56ca73a9 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -24,8 +24,8 @@ android { applicationId = ProjectSettings.Android.ApplicationId minSdk = ProjectSettings.Android.MinSdkVersion targetSdk = ProjectSettings.Android.TargetSdkVersion - versionCode = ProjectSettings.Android.VersionCode - versionName = ProjectSettings.Android.VersionName + versionCode = System.getenv("ANDROID_BUILD_NUMBER")?.toIntOrNull() ?: 1 + versionName = System.getenv("ANDROID_VERSION_NAME") ?: "1.x.x-local" } buildFeatures { @@ -48,9 +48,9 @@ android { } create(ProjectSettings.Android.BuildTypes.Release) { storeFile = file("keystore/todo_your_release_keystore.keystore") - storePassword = ProjectSettings.Android.Signing.Release.StorePassword - keyAlias = ProjectSettings.Android.Signing.Release.KeyAlias - keyPassword = ProjectSettings.Android.Signing.Release.KeyPassword + storePassword = System.getenv("ANDROID_KEYSTORE_PASSWORD").orEmpty() + keyAlias = System.getenv("ANDROID_KEY_ALIAS").orEmpty() + keyPassword = System.getenv("ANDROID_KEY_PASSWORD").orEmpty() } } diff --git a/buildSrc/src/main/kotlin/app/futured/kmptemplate/gradle/configuration/ProjectSettings.kt b/buildSrc/src/main/kotlin/app/futured/kmptemplate/gradle/configuration/ProjectSettings.kt index 83c36290..67179436 100644 --- a/buildSrc/src/main/kotlin/app/futured/kmptemplate/gradle/configuration/ProjectSettings.kt +++ b/buildSrc/src/main/kotlin/app/futured/kmptemplate/gradle/configuration/ProjectSettings.kt @@ -19,9 +19,6 @@ object ProjectSettings { const val ApplicationId = "app.futured.kmptemplate.android" - val VersionCode = System.getenv("ANDROID_BUILD_NUMBER")?.toInt() ?: 1 - val VersionName = System.getenv("ANDROID_VERSION_NAME") ?: "1.0.0" - val JavaCompatibility = JavaVersion.VERSION_17 const val KotlinJvmTargetNum = "17" @@ -37,12 +34,6 @@ object ProjectSettings { val KeyAlias = "androiddebugkey" val KeyPassword = "android" } - - object Release { - val StorePassword = System.getenv("ANDROID_KEYSTORE_PASSWORD").orEmpty() - val KeyAlias = System.getenv("ANDROID_KEY_ALIAS").orEmpty() - val KeyPassword = System.getenv("ANDROID_KEY_PASSWORD").orEmpty() - } } }