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

Beta release workflow #113

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
75 changes: 75 additions & 0 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release (Beta)

on:
push:
tags:
- v*.*.*
branches:
- fdoxyz/beta-release-workflow

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Cache Ruby - Bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-

- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches/
key: cache-clean-gradle-${{ matrix.os }}-${{ matrix.jdk }}

- name: Cache Gradle Wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper/
key: cache-clean-wrapper-${{ matrix.os }}-${{ matrix.jdk }}

- name: Grant Permission to Execute
run: chmod +x gradlew

- name: Install bundle
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: Configure Keystore
run: |
echo "This will fail because we don't have the secrets configured yet"
echo "$ANDROID_KEYSTORE_FILE" > keystore.jks.b64
base64 -d -i keystore.jks.b64 > app/keystore.jks
echo "storeFile=keystore.jks" >> keystore.properties
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow from which this was based on (here) creates the keystore.properties manually, but we can just base64 encode it whole instead if that feels cleaner. In that case we can replace KEYSTORE_KEY_ALIAS, KEYSTORE_KEY_PASSWORD and KEYSTORE_STORE_PASSWORD for a single secret. I don't feel strongly about either approach

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep it separate. it will be easier to update

echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
env:
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}

- name: Create Google Play Config file and google-services.json
run : |
echo "$SERVICE_ACCOUNT_JSON" > google-service-account-user.json.b64
base64 -d -i google-service-account-user.json.b64 > google-service-account-user.json
echo "$GOOGLE_SERVICES_JSON" > google-services.json.b64
base64 -d -i google-services.json.b64 > app/google-services.json
env:
SERVICE_ACCOUNT_JSON: ${{ secrets.SERVICE_ACCOUNT_JSON }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}

- name: Distribute app to Beta track 🚀
run: bundle exec fastlane beta
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ captures/
# Uncomment the following lines if you do not want to check your keystore files in.
*.jks
*.keystore
keystore.properties

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
Expand Down