Skip to content

initial fastlane structures from IzzyOnDroid #214

initial fastlane structures from IzzyOnDroid

initial fastlane structures from IzzyOnDroid #214

Workflow file for this run

name: Android CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
apk:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # Needed for version generation
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Ninja and check Android SDK
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Set permissions for gradlew
run: chmod +x gradlew
- name: Check Android SDK Details
run: |
echo "SDK Location:"
echo $ANDROID_SDK_ROOT
echo "Build Tools:"
ls -la $ANDROID_SDK_ROOT/build-tools/
echo "Platform Tools:"
ls -la $ANDROID_SDK_ROOT/platform-tools/
echo "NDK versions:"
ls -la $ANDROID_SDK_ROOT/ndk/
# Generate version based on date and commit
- name: Generate version
id: version
run: |
DATE=$(date +'%Y.%m.%d')
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION="${DATE}-${SHORT_SHA}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Generated version: ${VERSION}"
- name: Build
run: ./gradlew build
- uses: ilharp/sign-android-release@v1
name: Sign app APK
id: sign_app
with:
releaseDir: app/build/outputs/apk/release
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
buildToolsVersion: 34.0.0
# Only create releases on pushes to master, not on PRs
- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: AIS Catcher v${{ steps.version.outputs.version }}
body: |
Automated release of AIS Catcher
Built from commit: ${{ github.sha }}
## Changes
- Latest updates from master branch
## Downloads
- **app-debug.apk**: Debug version for testing
- **app-release-signed.apk**: Production-ready signed APK
draft: false
prerelease: false
- name: Upload Debug APK to Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/debug/app-debug.apk
asset_name: app-debug.apk
asset_content_type: application/vnd.android.package-archive
- name: Upload Signed APK to Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.sign_app.outputs.signedFile }}
asset_name: app-release-signed.apk
asset_content_type: application/vnd.android.package-archive
# Update Edge release for backward compatibility
- name: Update Edge release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Delete existing Edge release if it exists
gh release delete Edge --yes || true
# Create new Edge release
gh release create Edge \
--title "Latest Edge Build" \
--notes "Always contains the latest build from master branch.
**Note:** This release is updated automatically and maintains the same download URLs for backward compatibility.
For version-specific releases and automated updates, please use the numbered releases above.
Built from commit: ${{ github.sha }}
Version: v${{ steps.version.outputs.version }}" \
--prerelease
# Upload APKs to Edge release
gh release upload Edge app/build/outputs/apk/debug/app-debug.apk --clobber
gh release upload Edge ${{ steps.sign_app.outputs.signedFile }} --clobber
# Keep artifacts for PRs and additional backup
- name: Upload Debug APK Artifact
uses: actions/upload-artifact@v4
with:
name: debug-apk-${{ steps.version.outputs.version }}
path: app/build/outputs/apk/debug/app-debug.apk
- name: Upload Release APK Artifact
uses: actions/upload-artifact@v4
with:
name: release-apk-${{ steps.version.outputs.version }}
path: ${{ steps.sign_app.outputs.signedFile }}