mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Refactor: Improve version code and name generation for builds (#2407)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
48d2690a8c
commit
209a8e67de
5 changed files with 85 additions and 83 deletions
14
.github/workflows/reusable-android-build.yml
vendored
14
.github/workflows/reusable-android-build.yml
vendored
|
|
@ -57,14 +57,12 @@ jobs:
|
|||
build-scan-terms-of-use-agree: 'yes'
|
||||
add-job-summary: always
|
||||
|
||||
- name: Calculate Version Code with Git Commit Count and Offset
|
||||
- name: Calculate Version Code
|
||||
id: calculate_version_code
|
||||
run: |
|
||||
GIT_COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||
OFFSET=30630 # to ensure versionCode is above 30630 (our last manual versionCode)
|
||||
VERSION_CODE=$((GIT_COMMIT_COUNT + OFFSET))
|
||||
echo "Calculated versionCode: $VERSION_CODE (from $GIT_COMMIT_COUNT commits + $OFFSET offset)"
|
||||
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
|
||||
uses: ./.github/actions/calculate-version-code
|
||||
|
||||
- name: Expose Version Code as Environment Variable
|
||||
run: echo "VERSION_CODE=${{ steps.calculate_version_code.outputs.versionCode }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run Detekt, Build, Lint, and Local Tests
|
||||
run: ./gradlew :app:detekt :app:lintFdroidDebug :app:lintGoogleDebug :app:assembleDebug :app:testFdroidDebug :app:testGoogleDebug --configuration-cache --scan
|
||||
|
|
@ -92,4 +90,4 @@ jobs:
|
|||
path: |
|
||||
app/build/reports
|
||||
**/build/reports/detekt
|
||||
retention-days: 14
|
||||
retention-days: 14
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue