feat: add Gitea Actions workflow for automated Android APK release on tag push.

This commit is contained in:
JuruSysadmin 2026-01-07 09:47:11 -03:00
parent ca26b7b8fd
commit 7ca0916c3d
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
name: Release Build
on:
push:
tags:
- 'v*.*.*' # Aciona quando uma tag como v1.0.0 é criada
jobs:
build-and-release:
runs-on: ubuntu-latest
container:
image: harbor.seu-dominio.com/library/android-build-env:latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
- name: Build with Gradle
run: ./gradlew assembleRelease
- name: Rename APK with version
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
mv app/build/outputs/apk/release/app-release.apk \
app/build/outputs/apk/release/entregas-app-${VERSION}.apk
- name: Create Release
uses: actions/release@v1
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Entregas App ${{ steps.get_version.outputs.VERSION }}
body: |
${{ steps.get_version.outputs.VERSION }}
- Build automático do APK Android
- Versão: ${{ steps.get_version.outputs.VERSION }}
files: |
app/build/outputs/apk/release/entregas-app-${{ steps.get_version.outputs.VERSION }}.apk
draft: false
prerelease: false