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 - 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