mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-09-22 19:15:05 +03:00
a102b06b9c
Remove test/smoke jobs and ci-*.sh scripts; embed compile, packaging, and version setup directly in release.yml. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
827 B
YAML
25 lines
827 B
YAML
name: Set release version
|
|
description: Writes versionName/versionCode into build.gradle.kts for CI
|
|
|
|
inputs:
|
|
version:
|
|
description: Semantic version (e.g. 1.2.3)
|
|
required: true
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Set version
|
|
shell: bash
|
|
run: |
|
|
VERSION="${{ inputs.version }}"
|
|
VERSION_CODE="$(printf '%s' "$VERSION" | sed 's/[^0-9]//g')"
|
|
if [[ -z "$VERSION_CODE" ]]; then
|
|
VERSION_CODE=1
|
|
fi
|
|
GRADLE_FILE="build.gradle.kts"
|
|
sed -i.bak "s/extra\\[\"versionName\"\\] = \"[^\"]*\"/extra[\"versionName\"] = \"$VERSION\"/" "$GRADLE_FILE"
|
|
sed -i.bak "s/extra\\[\"versionCode\"\\] = [0-9]*/extra[\"versionCode\"] = $VERSION_CODE/" "$GRADLE_FILE"
|
|
rm -f "$GRADLE_FILE.bak"
|
|
echo "versionName=$VERSION versionCode=$VERSION_CODE"
|