Actions artifacts expire and aren't a stable download link. Add a tag trigger (v*) that, after the build, publishes a GitHub Release with the signed APKs attached via softprops/action-gh-release, using the repo's default GITHUB_TOKEN. Bump versionCode/versionName to 9/2.0.2 for the first tagged release.
62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: Build APK
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- claude/main-bugs-review-nd8dax
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: "17"
|
|
|
|
- name: Set up Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Install required SDK packages
|
|
run: sdkmanager "platforms;android-36" "build-tools;36.0.0"
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', 'gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
gradle-${{ runner.os }}-
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
- name: Build release APK
|
|
run: ./gradlew assembleRelease --stacktrace
|
|
|
|
- name: Upload APK artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: TurnProxy-apk
|
|
path: app/build/outputs/apk/release/*.apk
|
|
if-no-files-found: error
|
|
|
|
- name: Publish GitHub Release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: app/build/outputs/apk/release/*.apk
|
|
generate_release_notes: true
|