generated from NiklasEi/bevy_game_template
-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (70 loc) · 2.98 KB
/
release-android-google-play.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: release-android-google-play
on:
workflow_dispatch:
inputs:
version:
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
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 or publish to a different track directly
# see track at https://github.com/r0adkll/upload-google-play#inputs for more options
TRACK: internal
MOBILE_DIRECTORY: mobile
permissions:
contents: write
jobs:
bundle-sign-release:
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 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 ${{ env.MOBILE_DIRECTORY }}
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 }}