chore(ci): настройка CI/CD, release и Android-сборок

- GitHub Actions для сборки APK
- Docker и F-Droid packaging
- Подпись, keystore и release pipeline
- Исправления CI и тегов
This commit is contained in:
2026-01-17 23:37:17 +03:00
parent 098828d8d5
commit 022fb3dd99
4 changed files with 116 additions and 6 deletions

View File

@@ -0,0 +1,98 @@
name: Android Release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
# ------------------- Checkout -------------------
- name: Checkout
uses: https://git.daemonlord.ru/actions/checkout@v4
with:
fetch-depth: 0
tags: true
# ------------------- Setup JDK -------------------
- name: Set up JDK 17
uses: https://git.daemonlord.ru/actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# ------------------- Install Node.js -------------------
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs
# ------------------- Extract version -------------------
- name: Extract versionName
id: extract_version
run: |
VERSION=$(grep -oP 'versionName\s+"[^"]+"' app/build.gradle | head -n1 | cut -d'"' -f2 | tr -d '\r\n')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"
# ------------------- Stop if already released -------------------
- name: Stop if version already released
id: stop
run: |
VERSION=${{ steps.extract_version.outputs.version }}
if git show-ref --tags --quiet --verify "refs/tags/$VERSION"; then
echo "Version $VERSION already released, stopping job."
echo "CONTINUE=false" >> $GITHUB_ENV
else
echo "Version $VERSION not released yet, continuing workflow..."
echo "CONTINUE=true" >> $GITHUB_ENV
fi
# ------------------- Decode keystore -------------------
- name: Decode keystore
if: env.CONTINUE == 'true'
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/release.keystore
- name: Make Gradlew executable
if: env.CONTINUE == 'true'
run: chmod +x ./gradlew
# ------------------- Set up Android SDK -------------------
- name: Set up Android SDK
if: env.CONTINUE == 'true'
uses: https://git.daemonlord.ru/actions/setup-android@v3
# ------------------- Build Release APK -------------------
- name: Build Release APK
if: env.CONTINUE == 'true'
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: ./gradlew --no-daemon assembleRelease
# ------------------- Git tag -------------------
- name: Create git tag
if: env.CONTINUE == 'true'
run: |
git tag $VERSION
git push origin $VERSION
# ------------------- Gitea release -------------------
- name: Create Gitea Release
if: env.CONTINUE == 'true'
uses: https://git.daemonlord.ru/actions/gitea-release-action@v1
with:
server_url: https://git.daemonlord.ru
repository: ${{ gitea.repository }}
token: ${{ secrets.API_TOKEN }}
tag_name: ${{ steps.extract_version.outputs.version }}
name: Release ${{ steps.extract_version.outputs.version }}
body: |
Android release ${{ steps.extract_version.outputs.version }}
files: |
app/build/outputs/apk/release/*.apk

View File

@@ -4,26 +4,39 @@ plugins {
android {
namespace 'com.anabasis.vkchatmanager'
compileSdk {
version = release(36)
}
compileSdk 36
defaultConfig {
applicationId "com.anabasis.vkchatmanager"
minSdk 26
targetSdk 36
versionCode 3
versionName "1.1.1"
versionCode 10103
versionName "1.1.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
// --- Настройка signingConfigs ---
signingConfigs {
release {
// Путь к keystore — от корня проекта
storeFile file("release.keystore")
storePassword System.getenv("KEYSTORE_PASSWORD") ?: "change_me"
keyAlias System.getenv("KEY_ALIAS") ?: "change_me"
keyPassword System.getenv("KEY_PASSWORD") ?: "change_me"
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// Используем signingConfig release
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
@@ -31,7 +44,6 @@ android {
}
dependencies {
implementation libs.recyclerview
implementation libs.viewpager2
implementation libs.material

BIN
assets/app_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB