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
19
.github/actions/calculate-version-code/action.yml
vendored
Normal file
19
.github/actions/calculate-version-code/action.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
name: 'Calculate Version Code'
|
||||
description: 'Calculates the Android versionCode based on the Git commit count plus an offset.'
|
||||
outputs:
|
||||
versionCode:
|
||||
description: "The calculated version code"
|
||||
value: ${{ steps.calculate_version.outputs.VERSION_CODE }}
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Calculate Version Code
|
||||
id: calculate_version
|
||||
shell: bash
|
||||
run: |
|
||||
# This action assumes that the repo has been checked out with `fetch-depth: 0`
|
||||
GIT_COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||
OFFSET=30630
|
||||
VERSION_CODE=$((GIT_COMMIT_COUNT + OFFSET))
|
||||
echo "Calculated versionCode: $VERSION_CODE (from $GIT_COMMIT_COUNT commits + $OFFSET offset)"
|
||||
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_OUTPUT
|
||||
Loading…
Add table
Add a link
Reference in a new issue