Skip to content

Commit

Permalink
Merge pull request #67 from NiklasEi/release-workflow-to-google-plays…
Browse files Browse the repository at this point in the history
…tore

Workflow to release to google playstore
  • Loading branch information
NiklasEi authored Jul 28, 2023
2 parents 8d18c44 + 605c29f commit 670b881
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
51 changes: 48 additions & 3 deletions .github/workflows/release-android-google-play.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Version - in the form of v1.2.3'
description: 'GitHub Release'
required: true
type: string
play_release:
description: 'Release name from google play console'
required: true
type: string

# ToDo: adapt names
env:
# used for uploading the app to a GitHub release
GAME_EXECUTABLE_NAME: bevy_game
GAME_OSX_APP_NAME: BevyGame
BUNDLE_PATH: "target/x/release/android/mobile.aab"
PACKAGE_NAME: "me.nikl.bevygame"
# release track; you can promote a build to "higher" tracks in the play console
TRACK: internal

permissions:
contents: write
Expand All @@ -21,7 +29,44 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev lld llvm
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Add Android targets
run: rustup target add aarch64-linux-android
run: rustup target add aarch64-linux-android armv7-linux-androideabi
- name: Install cargo-binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install xbuild
run: cargo binstall --git https://github.com/NiklasEi/xbuild --bin-dir x xbuild -y
- name: Build app bundle
run: |
cd mobile
x doctor
x build --release --platform android --store play
- name: sign app bundle
run: |
KEYSTORE_PATH=${{ runner.temp }}/upload-keystore.jks
echo -n "${{ secrets.PLAYSTORE_KEYSTORE }}" | base64 --decode > $KEYSTORE_PATH
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore $KEYSTORE_PATH -storepass "${{ secrets.PLAYSTORE_KEYSTORE_PASSWORD }}" ${{ env.BUNDLE_PATH }} upload
- name: Upload self-signed bundle to GitHub
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.BUNDLE_PATH }}
asset_name: ${{ env.GAME_EXECUTABLE_NAME }}_${{ inputs.version }}_android.aab
release_name: ${{ inputs.version }}
tag: ${{ inputs.version }}
overwrite: true
- name: prepare Google play store secrets
run: |
SERVICE_ACCOUNT=${{ runner.temp }}/service-account.json
echo -n "${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}" | base64 --decode > $SERVICE_ACCOUNT
- name: upload bundle to Google play store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ runner.temp }}/service-account.json
packageName: ${{ env.PACKAGE_NAME }}
releaseName: ${{ inputs.play_release }}
releaseFiles: ${{ env.BUNDLE_PATH }}
track: ${{ env.TRACK }}
2 changes: 1 addition & 1 deletion .github/workflows/release-ios-testflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:

# ToDo: adapt names
env:
# used for uploading the app to a GitHub release
GAME_EXECUTABLE_NAME: bevy_game
GAME_OSX_APP_NAME: BevyGame

permissions:
contents: write
Expand Down
5 changes: 3 additions & 2 deletions mobile/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ android:
gradle: true
assets:
- "../assets/*"
icon: "../build/android/res/mipmap-mdpi/icon.png"
icon: "ios-src/Assets.xcassets/AppIcon.appiconset/icon_1024x1024.png"
manifest:
package: "me.nikl.bevygame"
version_code: 3
application:
label: "Bevy game"
ios:
icon: "../build/android/res/mipmap-mdpi/icon.png"
icon: "ios-src/Assets.xcassets/AppIcon.appiconset/icon_1024x1024.png"
info:
cf_bundle_display_name: "Bevy game"
cf_bundle_identifier: "me.nikl.bevygame"
Expand Down

0 comments on commit 670b881

Please sign in to comment.