Files
lunasea/.github/workflows/publish_android.yml
2022-06-24 15:46:41 -04:00

67 lines
2.0 KiB
YAML

name: Publish Android
on:
workflow_call:
inputs:
build-changelog:
required: true
type: string
build-flavor:
required: true
type: string
build-title:
required: true
type: string
secrets:
GOOGLE_PLAY_API:
required: true
jobs:
play-store:
name: Play Store
runs-on: ubuntu-latest
steps:
- name: Setup Environment
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
with:
channel: play-store
google-play-key: ${{ secrets.GOOGLE_PLAY_API }}
- name: Download Play Store Package
uses: actions/download-artifact@v3
with:
name: android-playstore-package
path: ${{ github.workspace }}/output
- name: Determine Release Channel
id: channel
uses: actions/github-script@v6
env:
FLAVOR: ${{ inputs.build-flavor }}
with:
result-encoding: string
script: |
const ref = process.env.FLAVOR || 'edge';
switch (ref) {
case 'beta': return 'alpha';
case 'candidate': return 'beta';
case 'stable': return 'production';
case 'edge':
default: return 'internal';
}
- name: Generate Changelog
env:
CHANGELOG: ${{ inputs.build-changelog }}
CHANGELOG_PATH: ${{ github.workspace }}/android/fastlane/metadata/android/en-CA/changelogs
run: |
mkdir -p $CHANGELOG_PATH
echo $CHANGELOG > $CHANGELOG_PATH/default.txt
- name: Deploy to Google Play Store
working-directory: ${{ github.workspace }}/android
env:
SUPPLY_JSON_KEY: ${{ github.workspace }}/keys/googleplay.json
run: bundle exec fastlane deploy_playstore track:${{ steps.channel.outputs.result }} aab:${{ github.workspace }}/output/lunasea-android.aab version_name:${{ inputs.build-title }}