Skip to content

Commit

Permalink
[#490] Add script for adding the release note
Browse files Browse the repository at this point in the history
  • Loading branch information
lydiasama committed Nov 9, 2023
1 parent ffbfa73 commit 6702350
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,19 @@ workflows:
events:
- push
branch_patterns:
- pattern: develop
- pattern: 'develop'
- pattern: 'chore/490*'
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: Generating 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 @@ -114,14 +119,27 @@ workflows:
events:
- push
branch_patterns:
- pattern: main
- pattern: 'main'
- pattern: 'chore/490*'
environment:
vars:
# Increase the clone depth to 50 to cover all commits from the latest tag
CM_CLONE_DEPTH: 50
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: Generating release notes with git commits from the latest tag
script: |
git fetch --all --tags
prev_tag=$(git for-each-ref --sort=-creatordate --format '%(objectname)' refs/tags | sed -n 2p )
notes=$(git log --pretty=format:"\n- %s" "$prev_tag"..HEAD)
echo "$notes" | tee release_notes.txt
artifacts:
- *artifacts_template_compose
- *artifacts_production_apk
Expand Down

0 comments on commit 6702350

Please sign in to comment.