Skip to content

Commit f97493b

Browse files
committed
Housekeeping: ignore Android build artifacts and publish APKs via Releases
1 parent 194dc51 commit f97493b

5 files changed

Lines changed: 106 additions & 0 deletions

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Android Widget Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: "Release tag (e.g. android-widget-v0.2.0)"
8+
required: true
9+
type: string
10+
release_name:
11+
description: "Release title"
12+
required: true
13+
default: "Chronicle Android Widget"
14+
type: string
15+
prerelease:
16+
description: "Mark release as prerelease"
17+
required: true
18+
default: true
19+
type: boolean
20+
push:
21+
tags:
22+
- "android-widget-v*"
23+
24+
permissions:
25+
contents: write
26+
27+
jobs:
28+
build-and-release:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Java 17
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: temurin
39+
java-version: "17"
40+
41+
- name: Set up Gradle
42+
uses: gradle/actions/setup-gradle@v4
43+
with:
44+
gradle-version: "8.10.2"
45+
46+
- name: Set up Android SDK
47+
uses: android-actions/setup-android@v3
48+
49+
- name: Install Android SDK packages
50+
run: |
51+
yes | sdkmanager --licenses > /dev/null
52+
sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"
53+
54+
- name: Build debug APK
55+
run: gradle -p android :app:assembleDebug
56+
57+
- name: Resolve release metadata
58+
id: meta
59+
shell: bash
60+
run: |
61+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
62+
echo "tag=${{ inputs.release_tag }}" >> "$GITHUB_OUTPUT"
63+
echo "name=${{ inputs.release_name }}" >> "$GITHUB_OUTPUT"
64+
echo "prerelease=${{ inputs.prerelease }}" >> "$GITHUB_OUTPUT"
65+
else
66+
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
67+
echo "name=Chronicle Android Widget ${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
68+
echo "prerelease=false" >> "$GITHUB_OUTPUT"
69+
fi
70+
71+
- name: Prepare release asset
72+
run: |
73+
mkdir -p dist
74+
cp android/app/build/outputs/apk/debug/app-debug.apk "dist/chronicle-widget-${{ steps.meta.outputs.tag }}.apk"
75+
76+
- name: Upload workflow artifact
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: chronicle-widget-apk-${{ steps.meta.outputs.tag }}
80+
path: dist/*.apk
81+
82+
- name: Publish GitHub release
83+
uses: softprops/action-gh-release@v2
84+
with:
85+
tag_name: ${{ steps.meta.outputs.tag }}
86+
target_commitish: ${{ github.sha }}
87+
name: ${{ steps.meta.outputs.name }}
88+
prerelease: ${{ steps.meta.outputs.prerelease }}
89+
files: dist/*.apk

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ local/
1616

1717
# Local desktop artifacts
1818
Thumbs.db
19+
.DS_Store
1920
Chronicle.png
2021
View_hero_layout.png
2122

2223
# Android companion app build artifacts
2324
android/.gradle/
25+
android/.kotlin/
26+
android/**/build/
2427
android/local.properties
28+
android/captures/
29+
*.iml
30+
*.jks
31+
*.keystore
32+
*.aab

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ http://localhost:1609
6868
## Documentation
6969
- API docs: [`docs/API_DOCUMENTATION.md`](docs/API_DOCUMENTATION.md)
7070
- Android widget companion: [`docs/ANDROID_WIDGET_COMPANION.md`](docs/ANDROID_WIDGET_COMPANION.md)
71+
- Android widget APK downloads: [GitHub Releases](https://github.com/seanap/Chronicle/releases)
7172
- Misery Index report: [`docs/MISERY_INDEX_REPORT.md`](docs/MISERY_INDEX_REPORT.md)
-7.33 MB
Binary file not shown.

docs/ANDROID_WIDGET_COMPANION.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ The launcher app (`Chronicle Widget`) contains a simple base URL setting.
3636
## Notes
3737
- WorkManager enforces a minimum interval; 61 minutes is honored.
3838
- If network fetch fails, widget falls back to last cached payload.
39+
40+
## APK Distribution
41+
- APK binaries are distributed through **GitHub Releases**, not committed in source control.
42+
- Release workflow: `.github/workflows/android-widget-release.yml`.
43+
- Trigger options:
44+
- Push a tag like `android-widget-v0.2.0`.
45+
- Or run the workflow manually (`workflow_dispatch`) and provide `release_tag`.
46+
- Release asset output name format: `chronicle-widget-<tag>.apk`.

0 commit comments

Comments
 (0)