Skip to content

Internal Or Beta Release #8

Internal Or Beta Release

Internal Or Beta Release #8

name: Internal Or Beta Release
on:
workflow_dispatch:
inputs:
release_type:
required: false
default: 'internal'
description: Please select the release type
type: choice
options:
- internal
- beta
env:
SUPPLY_UPLOAD_MAX_RETRIES: 5
jobs:
app_build:
name: Github Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4.2.2
with:
distribution: 'temurin'
java-version: '17'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/create-release-number
name: Create Release Number
id: rel_number
- uses: ./.github/actions/inflate-secrets
name: Inflate Secrets
with:
keystore: ${{ secrets.ORIGINAL_KEYSTORE_FILE }}
google-services: ${{ secrets.GOOGLESERVICES }}
playstore-creds: ${{ secrets.PLAYSTORECREDS }}
- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Release
env:
KEYSTORE_PATH: ${{ secrets.KEYSTORE_NAME }}
KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }}
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: |
./gradlew :androidApp:assembleRelease
- name: Archive Build
uses: actions/upload-artifact@v4
with:
path: ./**/*.apk
- name: Create Version File
if: github.event.inputs.release_type == 'beta'
shell: bash
env:
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: |
echo $VERSION_CODE > ./androidApp/build/outputs/version_code.txt
- name: Create Github Pre-Release
if: github.event.inputs.release_type == 'beta'
uses: softprops/action-gh-release@v2.0.8
with:
tag_name: ${{ steps.rel_number.outputs.version }}
body_path: ./androidApp/build/outputs/changelogGithub
draft: false
prerelease: true
files: |
./androidApp/build/outputs/apk/release/androidApp-release.apk
./androidApp/build/outputs/version_code.txt
- name: Print `git status`
run: git status
play_publish:
name: Play Publish
runs-on: ubuntu-latest
concurrency:
group: playstore_deploy
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4.2.2
with:
distribution: 'temurin'
java-version: '17'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Install Fastlane
run: |
gem install bundler:2.2.27
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/create-release-number
name: Create Release Number
id: rel_number
- uses: ./.github/actions/inflate-secrets
name: Inflate Secrets
with:
keystore: ${{ secrets.UPLOAD_KEYSTORE_FILE }}
google-services: ${{ secrets.GOOGLESERVICES }}
playstore-creds: ${{ secrets.PLAYSTORECREDS }}
- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Release
env:
KEYSTORE_PATH: ${{ secrets.KEYSTORE_NAME }}
KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_FILE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.UPLOAD_KEYSTORE_ALIAS }}
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }}
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: |
./gradlew :androidApp:bundleRelease
- name: Deploy to Play Store Internal
run: bundle exec fastlane android deploy_internal
- name: Promote Internal to Beta
if: github.event.inputs.release_type == 'beta'
run: bundle exec fastlane android promote_to_beta