Publish Custom App #143
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Custom App | |
on: | |
release: | |
types: [published] | |
branches: | |
- main | |
jobs: | |
# publish: | |
# runs-on: ubuntu-22.04 | |
# | |
# steps: | |
# - name: Retrieving custom app configuration | |
# uses: actions/checkout@v3 | |
# | |
# - name: Retrieving Kiwix Android source code | |
# run: git clone --depth=1 --single-branch --branch header_issue_in_custom_application https://github.com/kiwix/kiwix-android.git | |
# | |
# - name: Copying custom app configuration into Kiwix Android code base | |
# run: ./copy_files_to_kiwix_android.sh | |
# | |
# - name: Preparing signing material | |
# env: | |
# keystore: ${{ secrets.keystore }} | |
# playstore_json: ${{ secrets.PLAYSTORE_JSON }} | |
# run: | | |
# echo "$playstore_json" > kiwix-android/playstore.json | |
# echo "$keystore" | base64 -d > kiwix-android/kiwix-android.keystore | |
# | |
# - name: Set tag variable | |
# run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV | |
# | |
# - name: Publishing app to Google Play | |
# env: | |
# KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
# KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
# KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
# DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION: ${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }} | |
# run: | | |
# cd kiwix-android | |
# eval "./gradlew publish${TAG^}ReleaseApkWithExpansionFile" | |
publish_dummy_apk: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Retrieving custom app configuration | |
uses: actions/checkout@v3 | |
- name: Retrieving Kiwix Android source code | |
run: git clone --depth=1 --single-branch --branch header_issue_in_custom_application https://github.com/kiwix/kiwix-android.git | |
- name: Copying custom app configuration into Kiwix Android code base | |
run: ./copy_files_to_kiwix_android.sh | |
- name: Preparing signing material | |
env: | |
keystore: ${{ secrets.keystore }} | |
run: | | |
echo "$keystore" | base64 -d > kiwix-android/kiwix-android.keystore | |
- name: Set tag variable | |
run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV | |
- name: Check if 'new' attribute is true | |
run: | | |
cd ${TAG} | |
new=$(grep -o '"new": true' info.json) | |
if [ -n "$new" ]; then | |
echo "The 'new' attribute is true, proceeding to publish dummy apk..." | |
else | |
echo "The 'new' attribute is not true, skipping the next job." | |
exit 0 # Skip the job as APK is already published on play store | |
fi | |
- name: Generate dummy APK | |
env: | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION: ${{ secrets.DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION }} | |
run: | | |
cd kiwix-android | |
eval "./gradlew assemble${TAG^}Release" | |
- name: Upload APK as an artifact | |
uses: actions/upload-artifact@v2 | |
env: | |
UNIVERSAL_APK_NAME: custom-${TAG}-release.apk | |
UNIVERSAL_RELEASE_APK: kiwix-android/custom/build/outputs/apk/dwds/release/custom-dwds-universal-release.apk | |
with: | |
name: $UNIVERSAL_APK_NAME | |
path: kiwix-android/custom/build/outputs/apk/dwds/release/custom-dwds-universal-release.apk |