Skip to content

Commit 4e56383

Browse files
authored
Merge pull request #558 from nimblehq/chore/490-add-release-note-for-codemagic-cd
[#490] Add release note for Codemagic CD workflow
2 parents 91c7ac8 + 449f9da commit 4e56383

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

.cicdtemplate/.codemagic/codemagic.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ definitions:
66
environment:
77
groups:
88
- firebase_credentials
9+
java: 17
910
cache:
1011
cache_paths:
1112
- $HOME/.gradle/caches
@@ -52,13 +53,17 @@ workflows:
5253
events:
5354
- push
5455
branch_patterns:
55-
- pattern: develop
56+
- pattern: 'develop'
5657
scripts:
5758
- *detekt
5859
- *unit_test
5960
- name: Build APK for staging
6061
script: |
6162
./gradlew assembleStagingDebug -PversionCode=$BUILD_NUMBER
63+
- name: Generate release notes with the latest git commit
64+
script: |
65+
RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))"
66+
echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt
6267
artifacts:
6368
- *artifacts_test_report
6469
- *artifacts_staging_apk
@@ -78,13 +83,24 @@ workflows:
7883
events:
7984
- push
8085
branch_patterns:
81-
- pattern: main
86+
- pattern: 'main'
87+
environment:
88+
vars:
89+
# Increase the clone depth to 50 to cover all commits from the latest tag
90+
CM_CLONE_DEPTH: 50
91+
groups:
92+
- firebase_credentials
93+
java: 17
8294
scripts:
8395
- *detekt
8496
- *unit_test
8597
- name: Build APK for production
8698
script: |
8799
./gradlew assembleProductionDebug -PversionCode=$BUILD_NUMBER
100+
- name: Generate release notes with git commits from the latest tag
101+
script: |
102+
RELEASE_NOTE_CONTENT="$(git log --merges --pretty=%B $(git describe --abbrev=0 --tags)..HEAD | grep "\[")"
103+
echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt
88104
artifacts:
89105
- *artifacts_test_report
90106
- *artifacts_production_apk

codemagic.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ definitions:
66
environment:
77
groups:
88
- firebase_credentials
9+
java: 17
910
cache:
1011
cache_paths:
1112
- $HOME/.gradle/caches
@@ -54,14 +55,18 @@ workflows:
5455
events:
5556
- push
5657
branch_patterns:
57-
- pattern: develop
58+
- pattern: 'develop'
5859
scripts:
5960
- *detekt_on_template_compose
6061
- *unit_test_on_template_compose
6162
- name: Build APK for staging
6263
working_directory: ./template-compose
6364
script: |
6465
./gradlew assembleStagingDebug -PversionCode=$BUILD_NUMBER
66+
- name: Generate release notes with the latest git commit
67+
script: |
68+
RELEASE_NOTE_CONTENT="$((git log -1 --merges | grep "\[") | grep . && echo "" || echo $(git log -1 --merges --format=%B))"
69+
echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt
6570
artifacts:
6671
- *artifacts_template_compose
6772
- *artifacts_staging_apk
@@ -81,14 +86,25 @@ workflows:
8186
events:
8287
- push
8388
branch_patterns:
84-
- pattern: main
89+
- pattern: 'main'
90+
environment:
91+
vars:
92+
# Increase the clone depth to 50 to cover all commits from the latest tag
93+
CM_CLONE_DEPTH: 50
94+
groups:
95+
- firebase_credentials
96+
java: 17
8597
scripts:
8698
- *detekt_on_template_compose
8799
- *unit_test_on_template_compose
88100
- name: Build APK for production
89101
working_directory: ./template-compose
90102
script: |
91103
./gradlew assembleProductionDebug -PversionCode=$BUILD_NUMBER
104+
- name: Generate release notes with git commits from the latest tag
105+
script: |
106+
RELEASE_NOTE_CONTENT="$(git log --merges --pretty=%B $(git describe --abbrev=0 --tags)..HEAD | grep "\[")"
107+
echo "$RELEASE_NOTE_CONTENT" | tee release_notes.txt
92108
artifacts:
93109
- *artifacts_template_compose
94110
- *artifacts_production_apk

0 commit comments

Comments
 (0)