Build / Android #10
This file contains hidden or 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: Build / Android | |
| on: workflow_dispatch | |
| defaults: | |
| run: | |
| shell: bash | |
| # env: | |
| # CI: '' | |
| # SKIP_SIGNING: true | |
| jobs: | |
| build-mobile: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| # fail-fast: false | |
| matrix: | |
| os: [macos-latest] | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v3 | |
| # Set Current Date As Env Variable | |
| - name: Set current date as env variable | |
| run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| # Set Repository Name As Env Variable | |
| - name: Set repository name as env variable | |
| run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Change wrapper permissions | |
| working-directory: ./android | |
| run: chmod +x ./gradlew | |
| - name: Install Node.js, NPM and Yarn | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Set npm version | |
| run: npm install -g npm@10 | |
| - name: Authenticate with fontawesome NPM repo | |
| run: | | |
| echo "pwd=${PWD}" | |
| npm config set "@fortawesome:registry" https://npm.fontawesome.com/ | |
| npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONT_AWESOME_AUTH_TOKEN }} | |
| - name: Create .env file | |
| run: echo "${{ secrets.ENV_FILE }}" > .env | |
| - name: Install root dependencies | |
| run: npm install | |
| - name: Install the Android supporting files | |
| working-directory: ./android | |
| env: | |
| ANDROID_KEY_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }} | |
| ANDROID_UPLOAD_KEY_JKS: ${{ secrets.ANDROID_UPLOAD_KEY_JKS }} | |
| run: | | |
| # create variables | |
| KEY_PROPERTIES_FILE=./key.properties | |
| UPLOAD_KEY_JKS_FILE=./androiduploadkey.jks | |
| # create files | |
| echo -n "$ANDROID_KEY_PROPERTIES" | base64 --decode -o $KEY_PROPERTIES_FILE | |
| echo -n "$ANDROID_UPLOAD_KEY_JKS" | base64 --decode -o $UPLOAD_KEY_JKS_FILE | |
| - name: npm build-mobile | |
| run: npm run build-mobile | |
| # outputs to: | |
| # ./app/build/outputs/apk/release/app-release.apk | |
| # ./app/build/outputs/apk/debug/app-debug.apk | |
| - name: Build Project | |
| working-directory: ./android | |
| run: ./gradlew build | |
| # - name: Assemble APK Debug | |
| # working-directory: ./android | |
| # run: ./gradlew assembleDebug | |
| # - name: Build APK Release | |
| # working-directory: ./android | |
| # run: ./gradlew assemble | |
| # Create Bundle AAB Release | |
| # outputs to: | |
| # ./app/build/intermediates/intermediary_bundle/release/intermediary-bundle.aab | |
| # ./app/build/outputs/bundle/release/app-release.aab | |
| - name: Build App Bundle | |
| working-directory: ./android | |
| run: ./gradlew bundleRelease | |
| # Upload Bundle AAB Release | |
| # - name: Upload AAB (App Bundle) Release | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - App bundle(s) AAB release generated | |
| # path: ${{ env.main_project_module }}/build/outputs/bundle/release/ | |
| # - name: Create Release | |
| # id: create_release | |
| # uses: softprops/action-gh-release@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # tag_name: v${{ github.event.inputs.version }} | |
| # name: Release v${{ github.event.inputs.version }} | |
| # draft: true | |
| # prerelease: false | |
| # files: <<application name>>/<<application name>>_${{ github.event.inputs.version }}.apk | |
| - name : Upload to Google Play | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
| packageName: com.remoteit | |
| releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab | |
| track: internal | |
| status: inProgress | |
| inAppUpdatePriority: 0 | |
| userFraction: 0.2 | |
| # whatsNewDirectory: distribution/whatsnew | |
| # mappingFile: app/build/outputs/mapping/release/mapping.txt | |
| # debugSymbols: app/build/intermediates/merged_native_libs/release/out/lib/ |