3.12.0 #85
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 App | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Set tag variable | |
run: echo "TAG=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV | |
- name: Retrieve secrets to files | |
env: | |
KEYSTORE: ${{ secrets.keystore }} | |
SSH_KEY: ${{ secrets.ssh_key }} | |
run: | | |
echo "$KEYSTORE" | base64 -d > kiwix-android.keystore | |
echo "$SSH_KEY" | base64 -d > ssh_key | |
chmod 600 ssh_key | |
- name: Publish APK to download.kiwix.org | |
env: | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
UNIVERSAL_RELEASE_APK: app/build/outputs/apk/standalone/*universal*.apk | |
ARCHIVE_NAME: kiwix-${{ github.event.release.tag_name }}.apk | |
run: | | |
./gradlew assembleStandalone | |
cp ${UNIVERSAL_RELEASE_APK} ${ARCHIVE_NAME} | |
scp -P 30022 -vrp -i ssh_key -o StrictHostKeyChecking=no "$ARCHIVE_NAME" [email protected]:/data/download/release/kiwix-android/ | |
# This is temporary, once we will publish 3.7.0 then we will uncommented this code. | |
# # This is necessary for F-Droid | |
# - name: Publish "versionInfo" to download.kiwix.org | |
# run: | | |
# ./gradlew generateVersionCodeAndName | |
# scp -P 30022 -vrp -i ssh_key -o StrictHostKeyChecking=no VERSION_INFO [email protected]:/data/download/release/kiwix-android/ | |
- name: Upload APKs to Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "app/build/outputs/apk/standalone/**" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.TAG }} | |
allowUpdates: true | |
replacesArtifacts: true | |
- name: Publish bundle to Google Play | |
env: | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
PLAYSTORE_JSON: ${{ secrets.PLAYSTORE_JSON }} | |
run: | | |
echo "$PLAYSTORE_JSON" > playstore.json | |
./gradlew publishPlayStoreBundle --scan |