Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added reusable-android-demo-shop-publish.yaml #242

Merged
merged 5 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/reusable-android-demo-shop-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Reusable Android Publish

on:
workflow_call:
inputs:
packageName:
required: true
type: string
releaseFiles:
required: true
type: string
PROPERTIES_FILE:
required: true
type: string
secrets:
PLAY_ACCOUNT_AS_BASE64:
required: true
SIGNING_STORE_FILE:
required: true
SIGNING_STORE_PASSWORD:
required: true
SIGNING_KEY_ALIAS:
required: true
SIGNING_KEY_PASSWORD:
required: true
GITHUB_APP_ID:
required: true
GITHUB_APP_PRIVATE_KEY:
required: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }}

- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}

- name: Set up JDK 20
uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'zulu'

- name: Create Keystore file
run: |
echo "${{ secrets.SIGNING_STORE_FILE }}" | base64 --decode > app/keystore.jks

- name: Build Release AAB
run: ./gradlew bundleProdRelease
env:
SIGNING_STORE_FILE: app/keystore.jks
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}

- name: Deploy to Google Play Internal Testing
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_ACCOUNT_AS_BASE64 }}
packageName: ${{ inputs.packageName }}
releaseFiles: ${{ inputs.releaseFiles }}
track: "internal"

- name: Bump version
run: ./gradlew incrementVersion
env:
PROPERTIES_FILE: ${{ inputs.PROPERTIES_FILE }}

- name: Retrieve new version
id: versionName
run: |
version=$(grep "VERSION_NAME=" ${{ inputs.PROPERTIES_FILE }} | cut -d'=' -f2)
echo "versionName=$version" >> $GITHUB_ENV
echo "versionName=$version" >> $GITHUB_OUTPUT

- name: Commit changes
id: committer
uses: planetscale/ghcommit-action@v0.1.44
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
with:
repo: ${{ github.repository }}
branch: master
commit_message: 'chore: bump version to ${{ steps.versionName.outputs.versionName }}'
file_pattern: ${{ inputs.PROPERTIES_FILE }}