Skip to content

enterprises: show new messages directly (fixes #2294) (#2297) #131

enterprises: show new messages directly (fixes #2294) (#2297)

enterprises: show new messages directly (fixes #2294) (#2297) #131

name: myPlanet release
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
release:
name: myPlanet release
runs-on: ubuntu-latest
env:
ANDROID_NDK_VERSION: "21.3.6528147"
BUILD_TOOLS_VERSION: "30.0.2"
steps:
- name: checkout repository code
uses: actions/checkout@v3
- name: extract version from xml
id: getVersion
uses: mavrosxristoforos/[email protected]
with:
xml-file: 'app/src/main/res/values/versions.xml'
xpath: '//string'
- name: setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: install NDK
run: |
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${ANDROID_NDK_VERSION}" --sdk_root=${ANDROID_SDK_ROOT}
chmod +x ./gradlew
- name: build debug and release APK
run: |
./gradlew build
ls -alR app/build/outputs/apk
- name: build release AAB
run: |
./gradlew bundleRelease
ls -alR app/build/outputs/bundle
- name: sign release APK
uses: Tlaster/[email protected]
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
output: build/release/signed
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: sign release AAB
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: copy builds to directory and generate sha256
run: |
cp app/build/outputs/apk/debug/m* build/release/signed/
cp app/build/outputs/bundle/release/app-release.aab build/release/signed/myPlanet.aab
mv build/release/signed/myPlanet-build-signed.apk build/release/signed/myPlanet.apk
cd build/release/signed/
sha256sum myPlanet.apk > myPlanet.apk.sha256
sha256sum myPlanet.aab > myPlanet.aab.sha256
cd -
ls -alR build/release/signed
- name: rename APK/AAB with version and branch for artifact
if: github.ref != 'refs/heads/master'
run: |
mv build/release/signed/myPlanet.apk build/release/signed/myPlanet-${{ steps.getVersion.outputs.info }}-${GITHUB_REF##*/}.apk
mv build/release/signed/myPlanet.apk.sha256 build/release/signed/myPlanet-${{ steps.getVersion.outputs.info }}-${GITHUB_REF##*/}.apk.sha256
mv build/release/signed/myPlanet.aab build/release/signed/myPlanet-${{ steps.getVersion.outputs.info }}-${GITHUB_REF##*/}.aab
mv build/release/signed/myPlanet.aab.sha256 build/release/signed/myPlanet-${{ steps.getVersion.outputs.info }}-${GITHUB_REF##*/}.aab.sha256
ls -alR build/release/signed
- name: upload APK/AAB as build artifact
if: github.ref != 'refs/heads/master'
uses: actions/upload-artifact@v2
with:
name: APK
path: build/release/signed/*
- name: release signed APK and AAB on GitHub
if: github.ref == 'refs/heads/master'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/release/signed/*
tag: v${{ steps.getVersion.outputs.info }}
overwrite: true
file_glob: true