ci: add android release workflow for gitea
This commit is contained in:
94
.github/workflows/android-release.yml
vendored
Normal file
94
.github/workflows/android-release.yml
vendored
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
name: Android Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: https://git.daemonlord.ru/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
tags: true
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: https://git.daemonlord.ru/actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Extract versionName from Kotlin DSL
|
||||||
|
id: extract_version
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep -oP 'versionName\s*=\s*"[^"]+"' android/app/build.gradle.kts | head -n1 | cut -d'"' -f2 | tr -d '\r\n')
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "Failed to detect versionName in android/app/build.gradle.kts"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Detected version: $VERSION"
|
||||||
|
|
||||||
|
- name: Stop if version already released
|
||||||
|
id: version_check
|
||||||
|
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_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "Version $VERSION is new, continuing..."
|
||||||
|
echo "continue=true" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Decode keystore
|
||||||
|
if: steps.version_check.outputs.continue == 'true'
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/release.keystore
|
||||||
|
|
||||||
|
- name: Set up Android SDK
|
||||||
|
if: steps.version_check.outputs.continue == 'true'
|
||||||
|
uses: https://git.daemonlord.ru/actions/setup-android@v3
|
||||||
|
|
||||||
|
- name: Make Gradlew executable
|
||||||
|
if: steps.version_check.outputs.continue == 'true'
|
||||||
|
run: chmod +x ./android/gradlew
|
||||||
|
|
||||||
|
- name: Build release APK
|
||||||
|
if: steps.version_check.outputs.continue == 'true'
|
||||||
|
working-directory: android
|
||||||
|
env:
|
||||||
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
|
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||||
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
run: ./gradlew --no-daemon assembleRelease
|
||||||
|
|
||||||
|
- name: Create git tag
|
||||||
|
if: steps.version_check.outputs.continue == 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.extract_version.outputs.version }}"
|
||||||
|
git config user.name "android-release-bot"
|
||||||
|
git config user.email "android-release-bot@daemonlord.ru"
|
||||||
|
git tag "$VERSION"
|
||||||
|
git push origin "$VERSION"
|
||||||
|
|
||||||
|
- name: Create Gitea release
|
||||||
|
if: steps.version_check.outputs.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: |
|
||||||
|
android/app/build/outputs/apk/release/*.apk
|
||||||
@@ -368,3 +368,13 @@
|
|||||||
- Added dedicated Android CI workflow for `main` branch and PRs.
|
- Added dedicated Android CI workflow for `main` branch and PRs.
|
||||||
- CI now runs Android build, unit tests, lint, and androidTest assemble.
|
- CI now runs Android build, unit tests, lint, and androidTest assemble.
|
||||||
- Added optional detekt execution step (auto-skipped when detekt task is not configured).
|
- Added optional detekt execution step (auto-skipped when detekt task is not configured).
|
||||||
|
|
||||||
|
### Step 63 - Integration tests for auth/chat/realtime
|
||||||
|
- Kept repository-level integration coverage for auth/chat data flows (MockWebServer + in-memory storage).
|
||||||
|
- Added `RealtimePipelineIntegrationTest` to validate realtime event handling pipeline (`receive_message` -> Room state update).
|
||||||
|
- Consolidated quality checklist integration test coverage for auth/chat/realtime.
|
||||||
|
|
||||||
|
### Step 64 - Android release workflow
|
||||||
|
- Added dedicated release workflow (`.github/workflows/android-release.yml`) for `main` branch pushes.
|
||||||
|
- Adapted version extraction for Kotlin DSL (`android/app/build.gradle.kts`) and guarded release by existing git tag.
|
||||||
|
- Wired release build, git tag push, and Gitea release publication with APK artifact upload.
|
||||||
|
|||||||
Reference in New Issue
Block a user