Update package.json #63
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: FxBlox Android Deploy | |
on: [push] | |
jobs: | |
deploy-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' # Use the same Node.js version as your project requirements | |
- name: Yarn Install | |
run: yarn install | |
- name: Ensure Symlink | |
run: npm run ensure:symlink | |
- name: Install CMake | |
run: | | |
echo "##[group]Install CMake" | |
sdkmanager --install "cmake;3.10.2.4988404" | |
yes | sdkmanager --licenses | |
echo "##[endgroup]" | |
- name: Get NPM Package Version | |
run: echo "NPM_PACKAGE_VERSION=$(node -p "require('${{ github.workspace }}/apps/box/package.json').version")" >> $GITHUB_ENV | |
- name: Change Android VersionCode and VersionName | |
run: | | |
NEW_VERSION_NAME=$NPM_PACKAGE_VERSION | |
BUILD_GRADLE_PATH=${{ github.workspace }}/apps/box/android/app/build.gradle | |
sed -i '' "s/versionName \".*\"/versionName \"$NEW_VERSION_NAME\"/" $BUILD_GRADLE_PATH | |
- name: Build Android Release | |
run: | | |
cd ${{ github.workspace }}/apps/box/android | |
./gradlew assembleRelease | |
- name: Sign APK | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE64 }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
- name: Deploy to Google Play | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: land.fx.blox | |
releaseFiles: app/build/outputs/apk/release/app-release.apk | |
track: production |