Merge pull request #855 from YumNumm/chore/lints #183
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 Android | |
on: | |
push: | |
branches: | |
- develop | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 | |
env: | |
TZ: Asia/Tokyo | |
LANG: ja_JP.UTF-8 | |
steps: | |
# https://github.com/actions/checkout/tree/v4/ | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
fetch-depth: 0 | |
- name: Setup Application Runtime | |
uses: ./.github/actions/setup-application-runtime | |
# Certificateを取得するために、Deploy Keyを設定 | |
- name: Set up ssh key | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "${{ secrets.SSH_ID_ED25519 }}" | base64 -d > ~/.ssh/id_ed25519 | |
chmod 600 ~/.ssh/id_ed25519 | |
eval $(ssh-agent -s) | |
echo "Host github.com \n\tIdentityFile ~/.ssh/id_ed25519\n\tUser git\n\tIdentityiesOnly yes" >> ~/.ssh/config | |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
- name: Pre set up ruby | |
run: cp .ruby-version app/android/.ruby-version | |
- name: Set up ruby | |
# https://github.com/ruby/setup-ruby/tree/v1/ | |
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc | |
with: | |
bundler-cache: true | |
working-directory: app/android | |
# https://github.com/actions/setup-java/tree/v4/ | |
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b | |
with: | |
distribution: "oracle" | |
java-version: "17" | |
- name: Set Google Play Service Account | |
run: | | |
echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' | base64 -d > app/android/eqmonitor-main-4325501acd45.json | |
- name: Set .env | |
working-directory: app | |
run: echo '${{ secrets.ENV}}' | base64 -d > .env | |
- name: Regenerate code | |
working-directory: app | |
run: dart run build_runner build --delete-conflicting-outputs | |
- name: Extract keystore | |
run: | | |
echo '${{ secrets.SIGNING_KEY }}' | base64 -d > app/android/app/key.jks | |
echo '${{ secrets.FIREBASE_ANDROID }}' | base64 -d > app/android/app/google-services.json | |
echo '${{ secrets.KEY_PROPERTIES }}' | base64 -d > app/android/key.properties | |
- name: Build AAB | |
working-directory: app/android | |
run: bundle exec fastlane build | |
- name: Upload artifact aab | |
uses: actions/[email protected] | |
with: | |
path: app/build/app/outputs/bundle/release/app-release.aab | |
name: release-aab | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
# https://github.com/actions/checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Fetch all history for all tags and branches | |
fetch-depth: 0 | |
- name: Download artifact aab | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-aab | |
path: app/android/output | |
- name: Move aab | |
working-directory: app/android | |
run: mv output/app-release.aab output.aab | |
- name: Pre set up ruby | |
run: cp .ruby-version app/android/.ruby-version | |
- name: Set up ruby | |
# https://github.com/ruby/setup-ruby/tree/v1/ | |
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc | |
with: | |
bundler-cache: true | |
working-directory: app/android | |
- name: Set Google Play Service Account | |
run: | | |
echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' | base64 -d > app/android/eqmonitor-main-4325501acd45.json | |
- name: Upload | |
working-directory: app/android | |
run: bundle exec fastlane upload |