Skip to content

Commit 321fdb4

Browse files
dnoggleclaude
andcommitted
Add GitHub Actions workflows for automatic APK building
- Added build-apk.yml: Builds APK on every push and PR - Added release.yml: Creates GitHub releases with APKs when tags are pushed - APKs will be available as downloadable artifacts - Supports both debug and release builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2dd7fec commit 321fdb4

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed

.github/workflows/build-apk.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build APK
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'temurin'
23+
24+
- name: Setup Android SDK
25+
uses: android-actions/setup-android@v3
26+
27+
- name: Cache Gradle packages
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.gradle/caches
32+
~/.gradle/wrapper
33+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
34+
restore-keys: |
35+
${{ runner.os }}-gradle-
36+
37+
- name: Make gradlew executable
38+
run: chmod +x ./gradlew
39+
40+
- name: Build Debug APK
41+
run: ./gradlew assembleDebug
42+
43+
- name: Upload APK as artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: app-debug-apk
47+
path: app/build/outputs/apk/debug/app-debug.apk
48+
retention-days: 30
49+
50+
- name: Build Release APK
51+
run: ./gradlew assembleRelease
52+
53+
- name: Upload Release APK as artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: app-release-apk
57+
path: app/build/outputs/apk/release/app-release-unsigned.apk
58+
retention-days: 30

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Release APK
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Release tag'
11+
required: true
12+
default: 'v1.0.0'
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
28+
- name: Setup Android SDK
29+
uses: android-actions/setup-android@v3
30+
31+
- name: Cache Gradle packages
32+
uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.gradle/caches
36+
~/.gradle/wrapper
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
38+
restore-keys: |
39+
${{ runner.os }}-gradle-
40+
41+
- name: Make gradlew executable
42+
run: chmod +x ./gradlew
43+
44+
- name: Build Release APK
45+
run: ./gradlew assembleRelease
46+
47+
- name: Get release tag
48+
id: get_tag
49+
run: |
50+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
51+
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
52+
else
53+
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
54+
fi
55+
56+
- name: Create Release
57+
uses: softprops/action-gh-release@v1
58+
with:
59+
tag_name: ${{ steps.get_tag.outputs.tag }}
60+
name: Release ${{ steps.get_tag.outputs.tag }}
61+
body: |
62+
## What's Changed
63+
- Fixed screen rotation state reset bug
64+
- App now preserves user input and navigation state when device rotates
65+
66+
## Installation
67+
1. Download the APK file below
68+
2. Enable "Install from unknown sources" in your Android settings
69+
3. Install the APK on your device
70+
71+
**Note:** This is an unsigned release build. You may need to enable installation from unknown sources.
72+
files: |
73+
app/build/outputs/apk/release/app-release-unsigned.apk
74+
draft: false
75+
prerelease: false
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)