mirror of
https://github.com/Michatec/Radio.git
synced 2026-01-30 23:17:21 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f99b1fc54b | ||
|
|
c2b28fd6ec | ||
|
|
b8fedbf832 | ||
|
|
890c91d4e3 | ||
|
|
41785d03f0 | ||
|
|
0c1f59d98d | ||
|
|
43adf31b6d | ||
|
|
4bb8df555c | ||
|
|
a649daf387 | ||
|
|
ed098aa8a7 |
91
.github/workflows/gradle-publish.yml
vendored
Normal file
91
.github/workflows/gradle-publish.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: Build and publish APK
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
ANDROID_HOME: /usr/local/lib/android/sdk/
|
||||
APK_PATH: app/build/outputs/apk/release/Radio-release-unsigned.apk
|
||||
APKSIGNER: /usr/local/lib/android/sdk/build-tools/34.0.0/apksigner
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: adopt
|
||||
cache: gradle
|
||||
|
||||
- name: Cache Android SDK
|
||||
#id: cache-android-sdk
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.ANDROID_HOME }}
|
||||
key: ${{ runner.os }}-android-sdk
|
||||
|
||||
- name: Setup Android SDK
|
||||
## It is not necessary to check for cache hit as it
|
||||
## will not download Android SDK again
|
||||
#if: steps.cache-android-sdk.outputs.cache-hit != 'true'
|
||||
uses: android-actions/setup-android@v3
|
||||
with:
|
||||
packages: ''
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
- name: Build unsigned APK
|
||||
run: ./gradlew --no-daemon assembleRelease
|
||||
|
||||
- name: Check APK path
|
||||
run: ls -R app/build/outputs/apk
|
||||
|
||||
- name: Sign APK
|
||||
env:
|
||||
SIGN_CERT: ${{ secrets.SIGN_CERT }}
|
||||
SIGN_KEY: ${{ secrets.SIGN_KEY }}
|
||||
run: |
|
||||
echo "$SIGN_CERT" | base64 -d > cert.der
|
||||
echo "$SIGN_KEY" | base64 -d > key.der
|
||||
mv ${{ env.APK_PATH }} app-release.apk
|
||||
${{ env.APKSIGNER }} sign --key key.der --cert cert.der app-release.apk
|
||||
rm cert.der key.der
|
||||
|
||||
- name: Zipalign APK
|
||||
run: |
|
||||
/usr/local/lib/android/sdk/build-tools/34.0.0/zipalign -v -p 4 app-release.apk app-release-aligned.apk
|
||||
mv app-release-aligned.apk app-release.apk
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: app-release
|
||||
path: app-release.apk
|
||||
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: app-release
|
||||
path: app-release.apk
|
||||
|
||||
- name: Create release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "app-release.apk"
|
||||
draft: true
|
||||
@@ -13,7 +13,7 @@ android {
|
||||
versionCode 129
|
||||
versionName '12.9'
|
||||
resourceConfigurations += ['en', 'de', 'el', 'nl', 'pl', 'ru','uk', 'ja', 'da', 'fr']
|
||||
setProperty('archivesBaseName', 'Radio_' + versionName)
|
||||
setProperty('archivesBaseName', 'Radio')
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
||||
Reference in New Issue
Block a user