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

fix(native-app): Conditionally publish #17412

Closed
wants to merge 2 commits into from
Closed
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
26 changes: 20 additions & 6 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ definitions:
CM_CLONE_DEPTH: 200
NODE_OPTIONS: '--max-old-space-size=8192'
scripts:
- name: Check version change
script: |
CURRENT_VERSION=$(grep -m1 'version:' pubspec.yaml | awk '{print $2}')
PREVIOUS_VERSION=$(git show HEAD~1:pubspec.yaml | grep -m1 'version:' | awk '{print $2}')
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"
echo "VERSION_CHANGED=true" >> $CM_ENV
else
echo "Version unchanged"
echo "VERSION_CHANGED=false" >> $CM_ENV
fi
- name: Conditional Publishing
script: |
if ! [ "$VERSION_CHANGED" = "true" ]; then
echo "Version unchanged, skipping publishing"
exit 1
fi
- &check_changes
name: Check changes since last build
working_directory: .
Expand Down Expand Up @@ -138,8 +155,7 @@ workflows:
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
publishing:
<<: *ios_publishing
<<: *slack_errors
<<: [*ios_publishing, *slack_errors]

dev-app-ios:
<<: *base
Expand Down Expand Up @@ -204,8 +220,7 @@ workflows:
artifacts: &android_artifacts
- android/app/build/outputs/**/*.aab
publishing:
<<: *android_publishing
<<: *slack_errors
<<: [*android_publishing, *slack_errors]

dev-app-android:
<<: *base
Expand All @@ -232,5 +247,4 @@ workflows:
- *build_android
artifacts: *android_artifacts
publishing:
<<: *android_publishing
<<: *slack_errors
<<: [*android_publishing, *slack_errors]
Loading