ci(build): add dynamic version extraction from git tags

This commit is contained in:
zarazaex69
2026-04-08 11:07:51 +03:00
parent dd4a55b831
commit fa302edddd
2 changed files with 26 additions and 2 deletions
+19
View File
@@ -88,6 +88,25 @@ jobs:
distribution: 'temurin'
java-version: '21'
- name: Extract version from tag
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG_NAME="${{ github.ref_name }}"
VERSION_NAME="${TAG_NAME#v}"
elif [[ "${{ github.event.inputs.release_tag }}" != "" ]]; then
TAG_NAME="${{ github.event.inputs.release_tag }}"
VERSION_NAME="${TAG_NAME#v}"
else
VERSION_NAME="dev-$(git rev-parse --short HEAD)"
fi
VERSION_CODE=$(date +%s)
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
echo "Version: $VERSION_NAME ($VERSION_CODE)"
- name: Decode Keystore
uses: timheuer/base64-to-file@v1.2.4
id: android_keystore