diff --git a/.cicdtemplate/.codemagic/codemagic.yaml b/.cicdtemplate/.codemagic/codemagic.yaml index 1c26cbdb0..c21301bbc 100644 --- a/.cicdtemplate/.codemagic/codemagic.yaml +++ b/.cicdtemplate/.codemagic/codemagic.yaml @@ -6,6 +6,7 @@ definitions: environment: groups: - firebase_credentials + java: 17 cache: cache_paths: - $HOME/.gradle/caches @@ -52,13 +53,17 @@ workflows: events: - push branch_patterns: - - pattern: develop + - pattern: 'develop' scripts: - *detekt - *unit_test - name: Build APK for staging script: | ./gradlew assembleStagingDebug -PversionCode=$BUILD_NUMBER + - name: Generate release notes with the latest git commit + script: | + RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))" + echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt artifacts: - *artifacts_test_report - *artifacts_staging_apk @@ -78,13 +83,24 @@ workflows: events: - push branch_patterns: - - pattern: main + - pattern: 'main' + environment: + vars: + # Increase the clone depth to 50 to cover all commits from the latest tag + CM_CLONE_DEPTH: 50 + groups: + - firebase_credentials + java: 17 scripts: - *detekt - *unit_test - name: Build APK for production script: | ./gradlew assembleProductionDebug -PversionCode=$BUILD_NUMBER + - name: Generate release notes with git commits from the latest tag + script: | + RELEASE_NOTE_CONTENT="$(git log --merges --pretty=%B $(git describe --abbrev=0 --tags)..HEAD | grep "\[")" + echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt artifacts: - *artifacts_test_report - *artifacts_production_apk diff --git a/codemagic.yaml b/codemagic.yaml index 1e9de09bb..cf26e32ea 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -6,6 +6,7 @@ definitions: environment: groups: - firebase_credentials + java: 17 cache: cache_paths: - $HOME/.gradle/caches @@ -54,7 +55,7 @@ workflows: events: - push branch_patterns: - - pattern: develop + - pattern: 'develop' scripts: - *detekt_on_template_compose - *unit_test_on_template_compose @@ -62,6 +63,10 @@ workflows: working_directory: ./template-compose script: | ./gradlew assembleStagingDebug -PversionCode=$BUILD_NUMBER + - name: Generate release notes with the latest git commit + script: | + RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))" + echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt artifacts: - *artifacts_template_compose - *artifacts_staging_apk @@ -81,7 +86,14 @@ workflows: events: - push branch_patterns: - - pattern: main + - pattern: 'main' + environment: + vars: + # Increase the clone depth to 50 to cover all commits from the latest tag + CM_CLONE_DEPTH: 50 + groups: + - firebase_credentials + java: 17 scripts: - *detekt_on_template_compose - *unit_test_on_template_compose @@ -89,6 +101,10 @@ workflows: working_directory: ./template-compose script: | ./gradlew assembleProductionDebug -PversionCode=$BUILD_NUMBER + - name: Generate release notes with git commits from the latest tag + script: | + RELEASE_NOTE_CONTENT="$(git log --merges --pretty=%B $(git describe --abbrev=0 --tags)..HEAD | grep "\[")" + echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt artifacts: - *artifacts_template_compose - *artifacts_production_apk