mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-21 23:48:00 +00:00
fix: use commit-count based versionCode to prevent downgrade on Firebase
CI_BUILD_ID was using github.run_number which is per-workflow, causing different workflows to produce different versionCodes (144 vs 9). Now computed from git commit count + offset, consistent across all workflows. Also added bundle task to local auto-increment.
This commit is contained in:
@@ -130,8 +130,6 @@ env:
|
||||
|
||||
POLKASSEMBLY_SUMMARY_API_KEY: ${{ secrets.POLKASSEMBLY_SUMMARY_API_KEY }}
|
||||
|
||||
CI_BUILD_ID: ${{ github.run_number }}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{inputs.upload-name}}
|
||||
cancel-in-progress: true
|
||||
@@ -146,6 +144,14 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Compute version code from commit count
|
||||
run: |
|
||||
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||
VERSION_CODE=$((COMMIT_COUNT + 100))
|
||||
echo "CI_BUILD_ID=$VERSION_CODE" >> $GITHUB_ENV
|
||||
echo "Version code: $VERSION_CODE (commits: $COMMIT_COUNT + offset 100)"
|
||||
|
||||
- name: 📂 Set up DEV Google Services
|
||||
uses: davidSchuppa/base64Secret-toFile-action@v3
|
||||
|
||||
@@ -29,6 +29,4 @@ app/*.apk
|
||||
google-services.json
|
||||
**/google-services.json
|
||||
|
||||
# Version properties
|
||||
version.properties
|
||||
.kotlin/
|
||||
|
||||
@@ -25,7 +25,7 @@ def computeVersionCode() {
|
||||
return Integer.valueOf(System.env.CI_BUILD_ID)
|
||||
}
|
||||
// Local build - auto increment
|
||||
if (gradle.startParameter.taskNames.any { it.contains('assemble') || it.contains('install') }) {
|
||||
if (gradle.startParameter.taskNames.any { it.contains('assemble') || it.contains('install') || it.contains('bundle') }) {
|
||||
return incrementVersionCode()
|
||||
}
|
||||
return getVersionCodeFromFile()
|
||||
|
||||
Reference in New Issue
Block a user