Skip to content
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

[#490] Add release note for Codemagic CD workflow #558

Merged
merged 7 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .cicdtemplate/.codemagic/codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ definitions:
environment:
groups:
- firebase_credentials
java: 17
cache:
cache_paths:
- $HOME/.gradle/caches
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 18 additions & 2 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ definitions:
environment:
groups:
- firebase_credentials
java: 17
cache:
cache_paths:
- $HOME/.gradle/caches
Expand Down Expand Up @@ -54,14 +55,18 @@ workflows:
events:
- push
branch_patterns:
- pattern: develop
- pattern: 'develop'
scripts:
- *detekt_on_template_compose
- *unit_test_on_template_compose
- name: Build APK for staging
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
Expand All @@ -81,14 +86,25 @@ 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
Comment on lines +94 to +95
Copy link
Contributor Author

@lydiasama lydiasama Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add the environment groups here again. It seems to add the environments > vars above overrides the environment that we imported from configure_environment

java: 17
scripts:
- *detekt_on_template_compose
- *unit_test_on_template_compose
- name: Build APK for production
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
Expand Down
Loading