Update corrected hymn texts. Fix the hymn update logic. #109
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: Android CI | |
on: | |
push: | |
branches: [ "master", "release/**" ] | |
pull_request: | |
branches: [ "master", "release/**" ] | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
ALIAS: ${{ secrets.ALIAS }} | |
ANDROID_PUBLISHER_CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }} | |
KEYSTORE: "android-signing-keystore.jks" | |
HYMBOOK_GOOGLE_JSON: ${{ secrets.HYMBOOK_GOOGLE_JSON }} | |
WCCRM_HYMNS_JSON_URL: ${{ secrets.WCCRM_HYMN_CATALOG }} | |
WCCRM_TOPICS_JSON_URL: ${{ secrets.WCCRM_TOPICS }} | |
HYMN_ASSET_TOKEN: ${{ secrets.HYMN_ASSET_TOKEN_CLASSIC }} | |
WCCRM_HYMNS_JSON: "wccrm_hymns_v6.json" | |
WCCRM_TOPICS_JSON: "wccrm_topics.json" | |
WCCRM_TUNES_ASSET_DOWNLOAD_URL: ${{ secrets.WCCRM_TUNES_ASSET }} | |
WCCRM_SHEET_MUSIC_ASSET_DOWNLOAD_URL: ${{ secrets.WCCRM_CATALOG_ASSET }} | |
WCCRM_SHEET_MUSIC_ARCHIVE: "wccrm_sheet_music_v2.zip" | |
WCCRM_TUNES_ARCHIVE: "wccrm_hymns_v1.zip" | |
INTERNAL_DOWNLOAD_URL: "" | |
IS_RELEASE: ${{ github.event_name == 'release' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Prepare Build Environment | |
run: | | |
echo "KEYSTORE=$(readlink -f $KEYSTORE)" >> $GITHUB_ENV | |
echo "$SIGNING_KEY" | base64 -d > "$KEYSTORE" | |
echo "$HYMBOOK_GOOGLE_JSON" | base64 -d > app/google-services.json | |
rm -rf app/src/main/assets/*.json | |
mkdir app/src/main/assets/tunes | |
mkdir app/src/main/assets/sheets | |
wget -q -O app/src/main/assets/"$WCCRM_HYMNS_JSON" $WCCRM_HYMNS_JSON_URL | |
wget -q -O app/src/main/assets/"$WCCRM_TOPICS_JSON" $WCCRM_TOPICS_JSON_URL | |
wget -q -O app/src/main/assets/tunes/"$WCCRM_TUNES_ARCHIVE" $WCCRM_TUNES_ASSET_DOWNLOAD_URL | |
wget -q -O app/src/main/assets/sheets/"$WCCRM_SHEET_MUSIC_ARCHIVE" $WCCRM_SHEET_MUSIC_ASSET_DOWNLOAD_URL | |
- name: Publish to play store | |
if: github.event_name == 'release' | |
run: | | |
./gradlew publishBundle | |
- name: Publish to Internal Sharing | |
if: github.event_name != 'release' | |
run: | | |
./gradlew uploadReleasePrivateBundle | |
# Parse the internal sharing url | |
sudo apt-get install -y jq | |
echo "INTERNAL_DOWNLOAD_URL=$(cat app/build/outputs/internal-sharing/bundle/release/app-release.json | jq .downloadUrl)" >> $GITHUB_ENV | |
- name: Send email | |
if: ${{ env.IS_RELEASE != true }} # Only send email for test builds | |
uses: dawidd6/[email protected] | |
with: | |
server_address: smtp.gmail.com | |
server_port: 465 | |
username: ${{secrets.MAIL_USERNAME}} | |
password: ${{secrets.MAIL_PASSWORD}} | |
subject: Hymnbook internal app sharing | |
to: ${{secrets.APP_TESTERS}} | |
from: Github Actions | |
secure: true | |
body: Build job of ${{github.repository}} completed successfully! Download apk here ${{ env.INTERNAL_DOWNLOAD_URL }} |