Skip to content

Commit

Permalink
feat: Test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentKobz committed Jul 4, 2024
1 parent 91c20cf commit f0e9e4a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/playstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,13 @@ jobs:
uses: actions/checkout@v4

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

- name: Setup fastlane
run: |
cd enioka_scan
bundle install
cd ..
ruby-version: "3.0.2"
bundler-cache: true

- name: Restore json key # make sure that you restore the key in the correct directory (ref. fastlane/Appfile)
run: |
cd enioka_scan
cd 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 enioka_scan/app
echo "${{ secrets.SIGN_KEY }}" > myKeystore.keystore.asc
gpg -d --passphrase ${{ secrets.SIGN_PASSWORD }} --batch myKeystore.keystore.asc > myKeystore.keystore
cd ../..
run: echo "${{ secrets.GOOGLE_API_PUB_JSON_BASE64 }}" | base64 --decode > ${{ github.workspace }}/service-account.json

- name: Set up environment
uses: actions/setup-java@v4
Expand All @@ -46,7 +30,28 @@ jobs:
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Upload app to Play Store (Internal track)
# - name: Upload app to Play Store (Internal track)
# run: bundle exec fastlane internal
- name: Build bundle debug
run: ./gradlew demoscannerapp:bundleDebug

- name: Encode secrets to base64
run: |
cd enioka_scan
bundle exec fastlane internal
echo ${{ secrets.SIGN_KEY }} | base64 > sign_key_base64.txt
echo ${{ secrets.SIGN_PASSWORD }} | base64 > sign_password_base64.txt
- uses: r0adkll/sign-android-release@v1
name: Sign app bundle
with:
releaseDirectory: app/build/outputs/bundle/debug
signingKeyBase64: sign_key_base64.txt
signingKeyPasswordBase64: sign_password_base64.txt
alias: ${{ secrets.SIGN_KEYID }}

- name: Deploy to Play Store in internal track
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ github.workspace}}/service-account.json
packageName: com.enioka.scanner.demoscannerapp
releaseFile: app/build/outputs/bundle/release/demoscannerapp-debug.aab
track: qa
3 changes: 1 addition & 2 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
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
json_key_file("service-account.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
10 changes: 7 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ platform :android do

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

# Upload the AAB to play store (internal track)
upload_to_play_store(track: 'internal', validate_only: true)
upload_to_play_store(
package_name: "com.enioka.scanner.demoscannerapp.debug",
track: 'internal',
validate_only: true
)
end
end

0 comments on commit f0e9e4a

Please sign in to comment.