-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f9b4a7
commit 0226385
Showing
4 changed files
with
224 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: release-android | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- daily-build | ||
types: | ||
- completed | ||
workflow_dispatch: | ||
jobs: | ||
release-android: | ||
runs-on: ubuntu-latest | ||
|
||
if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
registry-url: 'https://npm.pkg.github.com' | ||
always-auth: true | ||
scope: '@onekeyhq' | ||
|
||
- name: Setup keys secret | ||
run: | | ||
echo ${{ secrets.AUTO_SUBMIT_GOOGLE_PLAY_KEY }} | base64 -d > packages/app/pc-api-8644398719570171123-0-dcae07e2afab.json | ||
rm -rf packages/app/android/app/google-services.json | ||
echo ${{ secrets.GOOGLE_SERVICE_ANDROID }} | base64 -d > packages/app/android/app/google-services.json | ||
- name: Setup Expo | ||
uses: OneKeyHQ/actions/expo-server@main | ||
with: | ||
eas-version: 5.x | ||
token: ${{ secrets.EXPO_TOKEN }} | ||
|
||
- name: Setup ENV BUILD_NUMBER to 1 | ||
if: ${{ !github.event.workflow_run }} | ||
run: | | ||
# Generate build number ------- start | ||
echo "BUILD_NUMBER=1" >> $GITHUB_ENV | ||
# Generate build number ------- end | ||
- name: Setup ENV BUILD_NUMBER by workflow_run | ||
if: ${{ github.event.workflow_run }} | ||
run: | | ||
echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" | ||
# Generate build number ------- start | ||
DATE=`date "+%Y%m%d"` | ||
run_number=$(($workflow_run_number % 100)) | ||
run_number=$(printf "%02d" $run_number) | ||
build_number="${DATE}${run_number}" | ||
echo '$build_number='$build_number | ||
echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV | ||
# Generate build number ------- end | ||
env: | ||
workflow_run_number: ${{ github.event.workflow_run.run_number}} | ||
|
||
- name: Dotenv Action | ||
id: dotenv | ||
uses: OneKeyHQ/actions/dotenv-action@main | ||
with: | ||
path: .env.version | ||
|
||
- name: Modify build.gradle | ||
uses: OneKeyHQ/actions/build-gradle-edit@main | ||
with: | ||
versionCode: ${{ env.BUILD_NUMBER }} | ||
versionName: ${{ steps.dotenv.outputs.version }} | ||
packageName: 'so.onekey.app.wallet' | ||
android_dir: ./apps/mobile | ||
|
||
- name: Write .env.version | ||
run: | | ||
# pass BUILD_NUMBER as env variable to expo server | ||
echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version | ||
- name: Inject Environment Variables | ||
env: | ||
COVALENT_KEY: ${{ secrets.COVALENT_KEY }} | ||
GITHUB_SHA: ${{ github.sha }} | ||
run: | | ||
echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env.expo | ||
echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env.expo | ||
- name: Build on EAS And Submit | ||
if: ${{ github.event.workflow_run }} | ||
run: | | ||
cd apps/mobile | ||
eas build --profile=production --platform android --non-interactive --no-wait --resource-class large | ||
eas build --profile=production-store --platform android --non-interactive --no-wait --resource-class large --auto-submit | ||
# eas build --profile=production-huawei --platform android --non-interactive --no-wait --resource-class large | ||
- name: Build on EAS | ||
if: ${{ !github.event.workflow_run }} | ||
run: | | ||
cd apps/mobile | ||
eas build --profile=production --platform android --non-interactive --no-wait --resource-class large |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: release-ios | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- daily-build | ||
types: | ||
- completed | ||
workflow_dispatch: | ||
jobs: | ||
release-ios: | ||
runs-on: ubuntu-latest | ||
|
||
if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
registry-url: 'https://npm.pkg.github.com' | ||
always-auth: true | ||
scope: '@onekeyhq' | ||
|
||
- name: Setup keys secret | ||
run: | | ||
echo ${{ secrets.GOOGLE_SERVICE_IOS }} | base64 -d > packages/app/ios/OneKeyWallet/GoogleService-Info.plist | ||
echo ${{ secrets.ASC_API_KEY }} | base64 -d > packages/app/AscApiKey.p8 | ||
- name: Setup Expo | ||
uses: OneKeyHQ/actions/expo-server@main | ||
with: | ||
eas-version: 5.x | ||
token: ${{ secrets.EXPO_TOKEN }} | ||
|
||
- name: Setup Credentials | ||
run: | | ||
mkdir packages/app/ios/certs | ||
echo ${{ secrets.CREDENTIALS_JSON }} | base64 -d > packages/app/credentials.json | ||
echo ${{ secrets.DIST_CERT_P12 }} | base64 -d > packages/app/ios/certs/dist.p12 | ||
echo ${{ secrets.ADHOC_PROFILE }} | base64 -d > packages/app/ios/certs/profile.mobileprovision | ||
echo ${{ secrets.ADHOC_SERVICE_EXTENSION_PROFILE }} | base64 -d > packages/app/ios/certs/serviceextension-profile.mobileprovision | ||
- name: Setup ENV BUILD_NUMBER to 1 | ||
if: ${{ !github.event.workflow_run }} | ||
run: | | ||
# Generate build number ------- start | ||
echo "BUILD_NUMBER=1" >> $GITHUB_ENV | ||
# Generate build number ------- end | ||
- name: Setup ENV BUILD_NUMBER by workflow_run | ||
if: ${{ github.event.workflow_run }} | ||
run: | | ||
echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" | ||
# Generate build number ------- start | ||
DATE=`date "+%Y%m%d"` | ||
run_number=$(($workflow_run_number % 100)) | ||
run_number=$(printf "%02d" $run_number) | ||
build_number="${DATE}${run_number}" | ||
echo '$build_number='$build_number | ||
echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV | ||
# Generate build number ------- end | ||
env: | ||
workflow_run_number: ${{ github.event.workflow_run.run_number}} | ||
|
||
- name: Dotenv Action | ||
id: dotenv | ||
uses: OneKeyHQ/actions/dotenv-action@main | ||
with: | ||
path: .env.version | ||
|
||
- name: Modify OneKeyWallet info.plist | ||
uses: OneKeyHQ/actions/build-plist-edit@main | ||
with: | ||
buildNumber: ${{ env.BUILD_NUMBER }} | ||
versionName: ${{ steps.dotenv.outputs.version }} | ||
projectName: OneKeyWallet | ||
dir: ./apps/mobile | ||
|
||
- name: Modify ServiceExtension info.plist | ||
uses: OneKeyHQ/actions/build-plist-edit@main | ||
with: | ||
buildNumber: ${{ env.BUILD_NUMBER }} | ||
versionName: ${{ steps.dotenv.outputs.version }} | ||
projectName: ServiceExtension | ||
dir: ./apps/mobile | ||
|
||
- name: Write .env.version | ||
run: | | ||
# pass BUILD_NUMBER as env variable to expo server | ||
echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version | ||
- name: Inject Environment Variables | ||
env: | ||
COVALENT_KEY: ${{ secrets.COVALENT_KEY }} | ||
GITHUB_SHA: ${{ github.sha }} | ||
run: | | ||
echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env.expo | ||
echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env.expo | ||
- name: Build on EAS And Auto Submit | ||
if: ${{ github.event.workflow_run }} | ||
run: | | ||
cd apps/mobile | ||
# eas build --profile=production --platform ios --non-interactive --no-wait | ||
# replace APP STORE provision | ||
echo ${{ secrets.APPSTORE_PROFILE }} | base64 -d > ./ios/certs/profile.mobileprovision | ||
echo ${{ secrets.APPSTORE_SERVICE_EXTENSION_PROFILE }} | base64 -d > ./ios/certs/serviceextension-profile.mobileprovision | ||
eas build --profile=production-store --platform ios --non-interactive --no-wait --auto-submit | ||
- name: Build on EAS | ||
if: ${{ !github.event.workflow_run }} | ||
run: | | ||
cd apps/mobile | ||
eas build --profile=production --platform ios --non-interactive --no-wait |
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