ci: add Android release build to GitHub Actions
Add android-build.yml for CI builds on push/PR, and add an android job to release.yml to attach versioned APKs to GitHub Releases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d7dddb3cf9
commit
34df2490f5
2 changed files with 113 additions and 0 deletions
56
.github/workflows/android-build.yml
vendored
Normal file
56
.github/workflows/android-build.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
name: Android Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths: ["android/**"]
|
||||
pull_request:
|
||||
paths: ["android/**"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: android
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Decode keystore
|
||||
env:
|
||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||
run: |
|
||||
echo "$KEYSTORE_BASE64" | base64 -d > release.keystore
|
||||
|
||||
- name: Create keystore.properties
|
||||
env:
|
||||
STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
||||
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
run: |
|
||||
cat > keystore.properties <<EOF
|
||||
storeFile=release.keystore
|
||||
storePassword=$STORE_PASSWORD
|
||||
keyAlias=$KEY_ALIAS
|
||||
keyPassword=$KEY_PASSWORD
|
||||
EOF
|
||||
|
||||
- name: Build release APK
|
||||
run: ./gradlew assembleRelease
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: picoclaw-release-apk
|
||||
path: android/app/build/outputs/apk/release/*.apk
|
||||
57
.github/workflows/release.yml
vendored
57
.github/workflows/release.yml
vendored
|
|
@ -98,3 +98,60 @@ jobs:
|
|||
gh release edit "${{ inputs.tag }}" \
|
||||
--draft=${{ inputs.draft }} \
|
||||
--prerelease=${{ inputs.prerelease }}
|
||||
|
||||
android:
|
||||
name: Android Release APK
|
||||
needs: create-tag
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
defaults:
|
||||
run:
|
||||
working-directory: android
|
||||
steps:
|
||||
- name: Checkout tag
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.tag }}
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Decode keystore
|
||||
env:
|
||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||
run: echo "$KEYSTORE_BASE64" | base64 -d > release.keystore
|
||||
|
||||
- name: Create keystore.properties
|
||||
env:
|
||||
STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
||||
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
run: |
|
||||
cat > keystore.properties <<EOF
|
||||
storeFile=release.keystore
|
||||
storePassword=$STORE_PASSWORD
|
||||
keyAlias=$KEY_ALIAS
|
||||
keyPassword=$KEY_PASSWORD
|
||||
EOF
|
||||
|
||||
- name: Build release APK
|
||||
run: ./gradlew assembleRelease
|
||||
|
||||
- name: Rename APK with version
|
||||
run: |
|
||||
mv app/build/outputs/apk/release/app-release.apk \
|
||||
app/build/outputs/apk/release/picoclaw-${{ inputs.tag }}.apk
|
||||
|
||||
- name: Upload APK to release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload "${{ inputs.tag }}" \
|
||||
app/build/outputs/apk/release/picoclaw-${{ inputs.tag }}.apk
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue