Skip to content

Commit

Permalink
Merge pull request #217 from lad-tech/ci
Browse files Browse the repository at this point in the history
build: use env
  • Loading branch information
Bibazavr authored Apr 26, 2024
2 parents 8f80f38 + 90d77de commit 05596d7
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 23 deletions.
32 changes: 25 additions & 7 deletions .github/actions/android/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
name: Android
description: 'Build android'

inputs:
ANDROID_KEYSTORE_BASE64:
description: ANDROID_KEYSTORE_BASE64
required: true
MYAPP_UPLOAD_KEY_ALIAS:
description: MYAPP_UPLOAD_KEY_ALIAS
required: true
MYAPP_UPLOAD_KEY_PASSWORD:
description: MYAPP_UPLOAD_KEY_PASSWORD
required: true
MYAPP_UPLOAD_STORE_PASSWORD:
description: MYAPP_UPLOAD_STORE_PASSWORD
required: true
GOOGLE_API_KEY:
description: GOOGLE_API_KEY
required: true


runs:
using: "composite"
steps:
- name: add release.keystore
shell: bash
# env:
# ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
# MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }}
# MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
# MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
env:
ANDROID_KEYSTORE_BASE64: ${{ inputs.ANDROID_KEYSTORE_BASE64 }}
MYAPP_UPLOAD_KEY_ALIAS: ${{ inputs.MYAPP_UPLOAD_KEY_ALIAS }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ inputs.MYAPP_UPLOAD_KEY_PASSWORD }}
MYAPP_UPLOAD_STORE_PASSWORD: ${{ inputs.MYAPP_UPLOAD_STORE_PASSWORD }}
run: |
echo -n ${ANDROID_KEYSTORE_BASE64} | base64 -d > ./${CUSTOM_DIR}/android/app/release.keystore
echo "MYAPP_UPLOAD_STORE_FILE=./release.keystore" >> ./${CUSTOM_DIR}/android/gradle.properties
Expand All @@ -37,8 +55,8 @@ runs:
- name: add GOOGLE_API_KEY
shell: bash
# env:
# GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
env:
GOOGLE_API_KEY: ${{ inputs.GOOGLE_API_KEY }}
run: |
echo ${GOOGLE_API_KEY} > GOOGLE_API_KEY.json
Expand Down
57 changes: 57 additions & 0 deletions .github/actions/ios/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Ios
description: 'Build ios'

inputs:
EXPORT_OPTIONS:
description: EXPORT_OPTIONS
required: true
IOS_SCHEME:
description: IOS_SCHEME
required: true
APP_STORE_API_ISSUER:
description: APP_STORE_API_ISSUER
required: true
APP_STORE_API_KEY:
description: MYAPP_UPLOAD_STORE_PASSWORD
required: true


runs:
using: "composite"
steps:
- name: install pods
shell: bash
run: |
cd ./${CUSTOM_DIR}/ios
NO_FLIPPER=1 pod install
- name: prepare
shell: bash
env:
EXPORT_OPTIONS: ${{ inputs.EXPORT_OPTIONS }}
run: |
cd ./${CUSTOM_DIR}/ios
NO_FLIPPER=1 pod install
echo ${EXPORT_OPTIONS} > ExportOptions.plist
- name: archive
shell: bash
env:
IOS_SCHEME: ${{ inputs.IOS_SCHEME }}
APP_STORE_API_ISSUER: ${{ inputs.APP_STORE_API_ISSUER }}
APP_STORE_API_KEY: ${{ inputs.APP_STORE_API_KEY }}
run: |
xcodebuild -workspace ${IOS_SCHEME}.xcworkspace -scheme $IOS_SCHEME -sdk iphoneos archive -archivePath ${PWD}/build/${IOS_SCHEME}.xcarchive -allowProvisioningUpdates -quiet
- name: exportArchive
shell: bash
env:
IOS_SCHEME: ${{ inputs.IOS_SCHEME }}
APP_STORE_API_ISSUER: ${{ inputs.APP_STORE_API_ISSUER }}
APP_STORE_API_KEY: ${{ inputs.APP_STORE_API_KEY }}
run: |
xcodebuild -exportArchive -archivePath ${PWD}/build/${IOS_SCHEME}.xcarchive -exportOptionsPlist ${PWD}/ExportOptions.plist -exportPath $PWD/build -authenticationKeyIssuerID $APP_STORE_API_ISSUER -authenticationKeyID $APP_STORE_API_KEY -allowProvisioningUpdates -quiet
- name: publish
shell: bash
env:
APP_STORE_API_ISSUER: ${{ inputs.APP_STORE_API_ISSUER }}
APP_STORE_API_KEY: ${{ inputs.APP_STORE_API_KEY }}
run: |
xcrun altool --upload-app -f ./build/*.ipa -t ios --apiKey $APP_STORE_API_KEY --apiIssuer $APP_STORE_API_ISSUER
19 changes: 14 additions & 5 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: Test
description: 'Run tests'
name: Release
description: 'Release package'

inputs:
GH_TOKEN:
description: GH_TOKEN
required: true
NPM_TOKEN:
description: NPM_TOKEN
required: true


runs:
using: "composite"
Expand All @@ -8,6 +17,6 @@ runs:
shell: bash
run: yarn release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ inputs.GH_TOKEN }}
NPM_TOKEN: ${{ inputs.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ inputs.NPM_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
workflow_call:
workflow_dispatch:

jobs:
android:
runs-on: ubuntu-latest
environment: production-android
concurrency: android
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: install
uses: ./.github/actions/install
- name: android
uses: ./.github/actions/android
with:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
ios:
runs-on: [self-hosted, macOS, ARM64, mobile]
environment: production-ios
concurrency: ios
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: install
uses: ./.github/actions/install
- name: ios
uses: ./.github/actions/ios
with:
EXPORT_OPTIONS: ${{ secrets.EXPORT_OPTIONS }}
IOS_SCHEME: ${{ secrets.IOS_SCHEME }}
APP_STORE_API_ISSUER: ${{ secrets.APP_STORE_API_ISSUER }}
APP_STORE_API_KEY: ${{ secrets.APP_STORE_API_KEY }}
16 changes: 5 additions & 11 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ on:
jobs:
checker:
uses: ./.github/workflows/checker.yml
android:
runs-on: ubuntu-latest
release:
needs: [checker]
environment: production
concurrency: android
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: install
uses: ./.github/actions/install
- name: android
uses: ./.github/actions/android
uses: ./.github/workflows/release.yml
build:
needs: [release]
uses: ./.github/workflows/build.yml
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Checker

on:
workflow_call:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
concurrency: release
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: install
uses: ./.github/actions/install
- name: android
uses: ./.github/actions/release
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 05596d7

Please sign in to comment.