deploy #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: macos-14 | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Load secrets from 1Password | |
uses: 1password/load-secrets-action@v2 | |
- name: Set up credentials | |
run: | | |
./setup_credentials | |
while read -r line; do echo "$line" >> $GITHUB_ENV; done < .env | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
bundler-cache: true | |
- name: Set up fastlane | |
run: | | |
gem install bundler | |
cd fastlane && bundle install | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
cache: gradle | |
- name: Validate service account key (for Google Play Android Developer) | |
run: | | |
cd fastlane | |
bundle exec fastlane run validate_play_store_json_key json_key:"$GOOGLE_PLAY_JSON_KEY_PATH" | |
- name: Deploy Android app | |
run: | | |
cd fastlane | |
if [ "$(git tag -l "$GITHUB_REF_NAME")" ]; then | |
op run -- bundle exec fastlane android internal | |
else | |
op run -- bundle exec fastlane android distribute | |
fi | |
- name: Deploy iOS app | |
run: | | |
cd fastlane | |
if [ "$(git tag -l "$GITHUB_REF_NAME")" ]; then | |
op run -- bundle exec fastlane ios prod | |
else | |
op run -- bundle exec fastlane ios distribute | |
fi | |
- name: Create release on GitHub | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref_name, 'v') | |
with: | |
name: ${{ github.ref_name }} | |
fail_on_unmatched_files: true | |
# see https://github.com/softprops/action-gh-release/issues/158 | |
files: | | |
android/build/outputs/bundle/release/android-release.aab | |
ios/build/robovm/IOSLauncher.ipa |