Skip to content

Build Relase

Build Relase #431

Workflow file for this run

name: Build Relase
on:
workflow_dispatch:
workflow_run:
workflows: ["Unit tests"]
types: [completed]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
CERTIFICATE_BASE64: ${{ secrets.CERTIFICATE_BASE64 }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'oracle'
- name: echo "*** Make gradlew executable ***"
run: chmod +x ./gradlew
- name: "*** base64 ***"
run: |
echo $CERTIFICATE_BASE64 | base64 -i -d > ${{ github.workspace }}/app/android-LQ0F5.keystore
- name: echo "*** Download bundletool ***"
run: |
RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/google/bundletool/releases/latest)
VERSION=$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
echo VERSION = $VERSION
URL=$(curl -L -o ./bundletool.jar https://github.com/google/bundletool/releases/download/$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')/bundletool-all-$(echo $RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/').jar)
- name: Build nokia5.json file
run: |
JSON_N5='{"supportedAbis":["arm64-v8a"],"supportedLocales":["sk"],"screenDensity":320,"sdkVersion":28}\n'
printf "$JSON_N5" "$supportedAbis" "$supportedLocales" "$screenDensity" "$sdkVersion" >> ./nokia5.json
- name: echo "*** assembleRelease ***"
run: ./gradlew assembleRelease
- name: echo "*** assembleDebug ***"
run: ./gradlew assembleDebug
- name: echo "*** Build app bundle all (.aab) ***"
run: ./gradlew app:bundle
- name: echo "*** Bundletool build apks all DEBUG (.apks) ***"
run: java -jar ./bundletool.jar build-apks --bundle=./app/build/outputs/bundle/debug/app-debug.aab --output=./MyApp/data_live_wallpaper_debug_all.apks --ks=./app/android-LQ0F5.keystore --ks-pass=pass:${{ secrets.KEYSTORE_PASSWORD }} --key-pass=pass:${{ secrets.KEY_PASSWORD }} --ks-key-alias=${{ secrets.KEY_ALIAS }}
- name: echo "*** Bundletool build apks all RELASE (.apks) ***"
run: java -jar ./bundletool.jar build-apks --bundle=./app/build/outputs/bundle/release/app-release.aab --output=./MyApp/data_live_wallpaper_relase_all.apks --ks=./app/android-LQ0F5.keystore --ks-pass=pass:${{ secrets.KEYSTORE_PASSWORD }} --key-pass=pass:${{ secrets.KEY_PASSWORD }} --ks-key-alias=${{ secrets.KEY_ALIAS }}
- name: echo "*** Bundletool build apks all NOKIA 5 DEBUG (.apks) ***"
run: java -jar ./bundletool.jar build-apks --device-spec=./nokia5.json --bundle=./app/build/outputs/bundle/debug/app-debug.aab --output=./MyApp/data_live_wallpaper_nokia5_debug.apks --ks=./app/android-LQ0F5.keystore --ks-pass=pass:${{ secrets.KEYSTORE_PASSWORD }} --key-pass=pass:${{ secrets.KEY_PASSWORD }} --ks-key-alias=${{ secrets.KEY_ALIAS }}
- name: echo "*** Bundletool build apks all NOKIA 5 RELASE (.apks) ***"
run: java -jar ./bundletool.jar build-apks --device-spec=./nokia5.json --bundle=./app/build/outputs/bundle/release/app-release.aab --output=./MyApp/data_live_wallpaper_nokia5_relase.apks --ks=./app/android-LQ0F5.keystore --ks-pass=pass:${{ secrets.KEYSTORE_PASSWORD }} --key-pass=pass:${{ secrets.KEY_PASSWORD }} --ks-key-alias=${{ secrets.KEY_ALIAS }}
- name: debug&relase_APK
uses: actions/upload-artifact@v4
with:
name: debug&relase_APK
path: |
./app/build/outputs/apk/debug/data_live_wallpaper_debug.apk
./app/build/outputs/apk/release/data_live_wallpaper_release.apk
- name: debug&relase_APKS
uses: actions/upload-artifact@v4
with:
name: debug&relase_APKS
path: |
./MyApp/data_live_wallpaper_debug_all.apks
./MyApp/data_live_wallpaper_relase_all.apks
- name: debug&relase_Nokia5_APKS
uses: actions/upload-artifact@v4
with:
name: debug&relase_Nokia5_APKS
path: |
./MyApp/data_live_wallpaper_nokia5_debug.apks
./MyApp/data_live_wallpaper_nokia5_relase.apks
- name: debug&relase_AAB
uses: actions/upload-artifact@v4
with:
name: debug&relase_AAB
path: |
./app/build/outputs/bundle/debug/app-debug.aab
./app/build/outputs/bundle/release/app-release.aab
- uses: actions/download-artifact@v4
with:
path: ./artifacts/
- name: tree
run: tree -h ${{ github.workspace }}/./artifacts//
- name: releases-x
uses: milankomaj/releases-x@v0.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: 'data_live_wallpaper_artifacts'
tag: 'all_artifacts'
rewrite: 'true'
files: |
${{ github.workspace }}/MyApp/data_live_wallpaper_debug_all.apks \
${{ github.workspace }}/MyApp/data_live_wallpaper_relase_all.apks \
${{ github.workspace }}/MyApp/data_live_wallpaper_nokia5_debug.apks \
${{ github.workspace }}/MyApp/data_live_wallpaper_nokia5_relase.apks \
./app/build/outputs/apk/debug/data_live_wallpaper_debug.apk \
./app/build/outputs/apk/release/data_live_wallpaper_release.apk
- name: get-size
run: |
echo Size : data_live_wallpaper_relase_all.apks
java -jar ./bundletool.jar get-size total --human-readable-sizes --apks=./MyApp/data_live_wallpaper_relase_all.apks
echo Size : --device-spec=./nokia5.json
java -jar ./bundletool.jar get-size total --human-readable-sizes --device-spec=./nokia5.json --apks=./MyApp/data_live_wallpaper_relase_all.apks
- name: echo "*** ReadmE ***"
run: |
rm -f ./.github/README.md
find ./artifacts/ -type f -print0 | xargs -0 sha256sum >> ./sha256.md
sed 's/ /|/1g' ./sha256.md >> ./data.md
sed -i 1i"<details><summary><strong>SHA-256</strong></summary>" ./data.md
sed -i '2i\'" " ./data.md
sed -i 3i"**sha256** | **file**" ./data.md
sed -i 4i"---: | :---:" ./data.md
cat ./README.md ./data.md > ./.github/README.md
echo "</details>" >> ./.github/README.md
timestamp=$(TZ='Europe/Bratislava' date)
echo timestamp=$(TZ='Europe/Bratislava' date)
git config --global user.email ${{ secrets.EMAIL }}
git config --global user.name ${{ secrets.NAME }}
git status
git log --pretty=oneline
git add -u
git commit -m "update" ./.github/README.md
git pull --rebase
git push