Mobile Release Production #1114
Workflow file for this run
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: Mobile Release Production | |
on: | |
push: | |
tags: | |
- '*standardnotes/web*' | |
workflow_dispatch: | |
jobs: | |
android: | |
defaults: | |
run: | |
working-directory: packages/mobile | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Java version | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Export version from package.json | |
run: | |
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV | |
- name: Setup react-native kernel and increase watchers | |
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
- name: Decode Production Android keystore | |
run: | | |
echo "${{ secrets.ANDROID_KEYSTORE }}" > keystore.keystore.asc | |
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.keystore.asc > android/app/keystore.keystore | |
- name: Install dependencies | |
run: yarn install --immutable | |
- run: yarn build:mobile | |
- name: Ruby Setup for Fastlane | |
uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: 'packages/mobile' | |
- name: fastlane | |
uses: maierj/[email protected] | |
env: | |
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} | |
ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD }} | |
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
GOOGLE_PLAY_JSON_KEY_DATA: ${{ secrets.GOOGLE_PLAY_JSON_KEY_DATA }} | |
with: | |
lane: 'android prod' | |
subdirectory: 'packages/mobile' | |
- name: Generate Release Notes | |
uses: ./actions/release-notes | |
with: | |
package: mobile | |
id: release-notes | |
continue-on-error: true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.CI_PAT_TOKEN }} | |
tag_name: "@standardnotes/mobile@${{ env.PACKAGE_VERSION }}" | |
name: "Mobile ${{ env.PACKAGE_VERSION }}" | |
body: ${{ steps.release-notes.outputs.result }} | |
prerelease: true | |
draft: false | |
files: | | |
packages/mobile/android/app/build/outputs/bundle/prodRelease/app-prod-release.aab | |
packages/mobile/android/app/build/outputs/apk/prod/release/app-prod-release.apk | |
ios: | |
defaults: | |
run: | |
working-directory: packages/mobile | |
runs-on: macos-latest | |
timeout-minutes: 90 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Export version from package.json | |
run: | |
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV | |
- name: Ruby Setup for Fastlane | |
uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: 'packages/mobile' | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Bundle install | |
run: bundle install | |
- name: Install pods | |
run: yarn install:pods | |
- run: yarn build:mobile | |
- name: Set ssh connection to Github | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Export Apple AppStore Connect API key | |
run: echo "${{ secrets.APPSTORE_CONNECT_KEY }}" > ios/Authkey.p8 | |
- name: Setup fastlane | |
uses: maierj/[email protected] | |
env: | |
FASTLANE_USER: ${{ secrets.FASTLANE_USER }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
with: | |
lane: 'ios setup' | |
subdirectory: 'packages/mobile' | |
- name: fastlane | |
uses: maierj/[email protected] | |
env: | |
APPLE_APP_ID: ${{ secrets.APP_APPLE_ID }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }} | |
APPSTORE_CONNECT_KEY_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ISSUER_ID }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
FASTLANE_USER: ${{ secrets.FASTLANE_USER }} | |
MATCH_CERTIFICATES_URL: ${{ secrets.MATCH_CERTIFICATES_URL }} | |
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }} | |
with: | |
lane: 'ios prod' | |
subdirectory: 'packages/mobile' | |