Skip to content

Commit 121c6d7

Browse files
committed
fix(android): add skip android build flag check in release workflow [skip android]
- Added a step to detect [skip android] flag in commit messages - Conditionally skip Android build if the flag is present - Log messages for skipping or proceeding with Android build - Ensure Android build runs only when the flag is absent - Preserve existing build and artifact copy steps unchanged
1 parent 5e1fa84 commit 121c6d7

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ jobs:
3535
echo "ℹ️ No [need ci] found"
3636
fi
3737
38+
# 🔍 Проверяем, есть ли флаг [skip android]
39+
- name: Check if [skip android] present
40+
id: skip_android
41+
run: |
42+
if git log ${{ github.event.before }}..${{ github.sha }} --pretty=format:"%s%b" | grep -q "\[skip android\]"; then
43+
echo "skip_build=true" >> $GITHUB_OUTPUT
44+
echo "🚫 Found [skip android] — skipping Android build"
45+
else
46+
echo "skip_build=false" >> $GITHUB_OUTPUT
47+
echo "✅ No [skip android] found — proceeding with Android build"
48+
fi
49+
3850
# 🔍 Определяем изменённые проекты
3951
- name: Detect changed projects
4052
id: detect
@@ -118,7 +130,8 @@ jobs:
118130
docker push "$IMAGE_NAME:latest"
119131
fi
120132
121-
if [ -f "capacitor.config.ts" ]; then
133+
# Skip Android build if [skip android] flag is present
134+
if [ -f "capacitor.config.ts" ] && [ "${{ steps.skip_android.outputs.skip_build }}" = "false" ]; then
122135
echo "${{ secrets.KEYSTORE }}" | base64 --decode > "${{ github.workspace }}/$project/my-dashboard.jks"
123136
ls "${{ github.workspace }}/$project"
124137
@@ -133,6 +146,8 @@ jobs:
133146
ls -la ${{ github.workspace }}/$project/android/app/build/outputs/apk/release/
134147
mkdir -p ${{ github.workspace }}/$project/artifacts
135148
cp -R ${{ github.workspace }}/$project/android/app/build/outputs/apk/release/* ${{ github.workspace }}/$project/artifacts/
149+
elif [ -f "capacitor.config.ts" ] && [ "${{ steps.skip_android.outputs.skip_build }}" = "true" ]; then
150+
echo "⏭️ Skipping Android build for $project due to [skip android] flag"
136151
fi
137152
138153
cd -
@@ -237,4 +252,4 @@ jobs:
237252
\"reply_markup\": {\"inline_keyboard\": ${BUTTONS}}
238253
}" >/dev/null 2>&1
239254
fi
240-
done
255+
done

0 commit comments

Comments
 (0)