ci: support distribute ios appstore on ci. #7
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: Build and deploy Android Release | |
on: | |
push: | |
tags: | |
- 'android-release-*' | |
branches: | |
- 'ci/android-release-*' | |
- ci/* | |
workflow_dispatch: | |
inputs: | |
buildchannel: | |
description: 'Build Channel' | |
required: true | |
default: 'selfhost' | |
type: choice | |
options: | |
- selfhost | |
- appstore | |
REALLY_UPLOAD: | |
required: true | |
type: boolean | |
default: true | |
workflow_call: | |
secrets: | |
RABBY_MOBILE_ANDROID_KEY_STORE: | |
required: true | |
RABBY_MOBILE_ANDROID_KEY_PASSWORD: | |
required: true | |
RABBY_MOBILE_ANDROID_KEY_ALIAS: | |
required: true | |
RABBY_MOBILE_KR_PWD: | |
required: true | |
# defaults: | |
# run: | |
# shell: bash -ieo pipefail {0} | |
env: | |
BUILD_TARGET_PLATFORM: android | |
jobs: | |
release-build: | |
name: android-release-build | |
runs-on: | |
- self-hosted | |
- mobile | |
- macOS | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Actions Variables | |
id: actionvars | |
shell: bash | |
run: | | |
trigger_date=$(date +'%Y%m%d%H%M%S') | |
echo "trigger_date=$trigger_date" >> "$GITHUB_OUTPUT" | |
flatten_refname=${GITHUB_REF_NAME//\//'_'} | |
flatten_refname=${flatten_refname//\./'_'} | |
echo "flatten_refname=$flatten_refname" >> "$GITHUB_OUTPUT" | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' # See 'Supported distributions' for available options | |
java-version: '17' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Setup & Install dependencies | |
run: | | |
yarn --version; | |
# yarn setup && yarn postinstall; | |
yarn install; | |
cd apps/mobile; | |
bundle install; | |
env: | |
FLATTEN_REFNAME: ${{ steps.actionvars.outputs.flatten_refname }} | |
TRIGGER_DATE: ${{ steps.actionvars.outputs.trigger_date }} | |
- name: Build app | |
env: | |
RABBY_MOBILE_BUILD_BUCKET: ${{ secrets.RABBY_MOBILE_BUILD_BUCKET }} | |
RABBY_MOBILE_KR_PWD: ${{ secrets.RABBY_MOBILE_KR_PWD }} | |
RABBY_MOBILE_ANDROID_KEY_STORE: ${{ secrets.RABBY_MOBILE_ANDROID_KEY_STORE }} | |
RABBY_MOBILE_ANDROID_KEY_PASSWORD: ${{ secrets.RABBY_MOBILE_ANDROID_KEY_PASSWORD }} | |
RABBY_MOBILE_ANDROID_KEY_ALIAS: ${{ secrets.RABBY_MOBILE_ANDROID_KEY_ALIAS }} | |
RABBY_MOBILE_SENTRY_AUTH_TOKEN2: ${{ secrets.RABBY_MOBILE_SENTRY_AUTH_TOKEN2 }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.RABBY_MOBILE_SENTRY_AUTH_TOKEN2 }} | |
LARK_CHAT_URL: ${{ secrets.LARK_CHAT_URL }} | |
LARK_CHAT_SECRET: ${{ secrets.LARK_CHAT_SECRET }} | |
RABBY_ROBOT_LARK_APP_ID: ${{ secrets.RABBY_ROBOT_LARK_APP_ID }} | |
RABBY_ROBOT_LARK_APP_SECRET: ${{ secrets.RABBY_ROBOT_LARK_APP_SECRET }} | |
buildchannel: ${{ inputs.buildchannel }} | |
REALLY_UPLOAD: ${{ inputs.REALLY_UPLOAD }} | |
# see more details on https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
GIT_ACTIONS_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }} | |
GIT_COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} | |
GIT_REF_NAME: ${{ github.ref_name }} | |
GIT_REF_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
cd apps/mobile; | |
yarn prepare-archive; | |
[ -z $buildchannel ] && export buildchannel=selfhost-reg; | |
REALLY_UPLOAD=true ./scripts/deploy-android.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rabbymobile-${{ steps.actionvars.outputs.flatten_refname }}-${{ steps.actionvars.outputs.trigger_date }} | |
path: | | |
./apps/mobile/android/app/build/outputs/apk/release/app-release.apk | |
retention-days: 7 |