Skip to content

Commit

Permalink
feat: Add Release PlayStore CD
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentKobz committed Jul 3, 2024
1 parent 1708abc commit 5334b44
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/playstore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PlayStore release

on:
push:
branches:
- playstore-cd

jobs:
playstore:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "3.x"

- name: Setup fastlane
run: |
cd android
bundle install
cd ..
- name: Restore json key # make sure that you restore the key in the correct directory (ref. fastlane/Appfile)
run: |
cd android/fastlane
echo "${{ secrets.GOOGLE_API_PUB_JSON }}" | base64 --decode > service-account.json
cd ../..
- name: Restore keystore # make sure that you restore the key in the correct directory (same as app/gradle.properties)
run: |
cd android/app
echo "${{ secrets.SIGN_KEY }}" > myKeystore.keystore.asc
gpg -d --passphrase ${{ secrets.SIGN_PASSWORD }} --batch myKeystore.keystore.asc > myKeystore.keystore
cd ../..
- name: Set up environment
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Upload app to Play Store (Internal track)
run: |
cd android
bundle exec fastlane internal
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
2 changes: 2 additions & 0 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
json_key_file("fastlane/service-account.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("com.enioka.scanner.demo") # e.g. com.krausefx.app
33 changes: 33 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:android)

platform :android do

# LANE 1
desc "Publish a new version to the Google Play (INTERNAL)"
lane :internal do

# Generate AAB file
gradle(
task: "bundle",
build_type: "Release"
)

# Upload the AAB to play store (internal track)
upload_to_play_store(track: 'internal', validate_only: true)
end
end

0 comments on commit 5334b44

Please sign in to comment.