Skip to content

Commit

Permalink
feat: update version github action (#1802)
Browse files Browse the repository at this point in the history
* remove: unused code

* remove: .envrc

* update: .gitignore

* add: react-native-config

* feat: migrate to react-native-config

* fix: tests

* add: scripts

* show .env file content

* remove: mmkv key

* fix: quotes

* fix: MMKV_KEY

* add: FOR_DETOX flag for android

* update: Gemfile.lock

* add: submit_latest_to_review job
  • Loading branch information
ragozin-nikita authored Mar 19, 2024
1 parent 95d1d6f commit 0cb608f
Show file tree
Hide file tree
Showing 60 changed files with 813 additions and 518 deletions.
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

7 changes: 0 additions & 7 deletions .github/workflows/distribute-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ on:
- true
- false

# DEFAULT_BACKEND:
# type: choice
# description: HAQQ_BACKEND_DEFAULT
# options:
# - ${{secrets.HAQQ_BACKEND}}
# - ${{secrets.HAQQ_BACKEND_DEV}}

BUILD_DESCRIPTION:
required: true
description: Please add a short note for a new build
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/distribute-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ on:
options:
- true
- false
# DEFAULT_BACKEND:
# type: choice
# description: HAQQ_BACKEND_DEFAULT
# options:
# - ${{secrets.HAQQ_BACKEND}}
# - ${{secrets.HAQQ_BACKEND_DEV}}

BUILD_DESCRIPTION:
required: true
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ on:
options:
- true
- false
# DEFAULT_BACKEND:
# type: choice
# description: HAQQ_BACKEND_DEFAULT
# options:
# - ${{secrets.HAQQ_BACKEND}}
# - ${{secrets.HAQQ_BACKEND_DEV}}
BUILD_DESCRIPTION:
required: true
description: Please add a short note for a new build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
echo "DETOX_PROVIDER=${{secrets.DETOX_PROVIDER}}" >> .env
echo "DETOX_CHAIN_ID=${{secrets.DETOX_CHAIN_ID}}" >> .env
echo "MMKV_KEY=${{secrets.MMKV_KEY}}" >> .env
echo "FOR_DETOX=true" >> .env
- name: Build android app
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/merged-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
pull_request:
types:
- closed

jobs:
releaseAfterMerge:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'releaseAfterMerge')
runs-on: self-hosted
steps:
- run: |
echo ReleaseAfterMerge action
34 changes: 34 additions & 0 deletions .github/workflows/review-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Submit latest to Review

on:
workflow_dispatch:
workflow_call:

jobs:
submit_latest_to_review:
runs-on: self-hosted
steps:
- name: Show self-hosted machine infomation
run: uname -a

- uses: actions/checkout@v4
with:
token: ${{ secrets.SERVICE_TOKEN }}

- name: Decode secrets
run: |
echo ${{secrets.GOOGLE_SERVICE_ACCOUNT}} | base64 -d > android/app/google-account.json
- name: Install Fastlane
run: |
bundle install
- name: Execute Fastlane command
run: |
bundle exec fastlane ios submit_latest_to_review
bundle exec fastlane android submit_latest_to_review
env:
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}
DEVELOPER_APP_IDENTIFIER: ${{ secrets.IOS_IDENTIFIER }}
36 changes: 36 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update version

on:
workflow_dispatch:
inputs:
version_type:
type: choice
description: Version type to update
default: patch
options:
- major
- minor
- patch

jobs:
update_version:
runs-on: self-hosted
steps:
- name: Show self-hosted machine infomation
run: uname -a

- uses: actions/checkout@v4
with:
token: ${{ secrets.SERVICE_TOKEN }}

- name: Execute Update script
run: |
yarn env:update ${{github.event.inputs.version_type}}
- name: Create a commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "Build"
git pull origin main
git commit -am "update: version"
git push --force-with-lease
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ google-account.json

# e2e tests artifacts
artifacts/*

# react-native-config codegen
ios/tmp.xcconfig
19 changes: 10 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ GEM
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
cocoapods (1.12.1)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.12.1)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
Expand All @@ -50,8 +50,8 @@ GEM
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.12.1)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -62,7 +62,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand Down Expand Up @@ -158,7 +158,7 @@ GEM
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
fastlane-plugin-increment_version_code (0.4.3)
fastlane-plugin-increment_version_name (0.0.10)
ffi (1.15.5)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
Expand Down Expand Up @@ -252,7 +252,7 @@ GEM
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
typhoeus (1.4.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand All @@ -279,7 +279,8 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.12.1, >= 1.12.1)
activesupport (>= 6.1.7.3, < 7.1.0)
cocoapods (~> 1.13)
fastlane (~> 2.213.0, >= 2.213.0)
fastlane-plugin-firebase_app_distribution
fastlane-plugin-increment_version_code
Expand Down
3 changes: 2 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"
apply plugin: "kotlin-android"
Expand Down Expand Up @@ -103,7 +104,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 397
versionName "1.7.0"
versionName project.env.get("APP_VERSION")
missingDimensionStrategy 'react-native-camera', 'general'
manifestPlaceholders = [
appAuthRedirectScheme : 'haqq'
Expand Down
4 changes: 3 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
# Add any project specific keep options here:
-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.**{ *; }
-keep interface com.google.android.gms.** { *; }
-keep interface com.google.android.gms.** { *; }
-keep class com.haqq.wallet.BuildConfig { *; }
-keepresources string/build_config_package
11 changes: 0 additions & 11 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ module.exports = function (api) {
},
},
],
[
'module:react-native-dotenv',
{
envName: 'APP_ENV',
moduleName: '@env',
path: '.env',
safe: false,
allowUndefined: true,
verbose: false,
},
],
'react-native-reanimated/plugin',
];

Expand Down
2 changes: 1 addition & 1 deletion e2e/7_coin_delegation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe.skip('Coin delegation and undelegation', () => {
}
}

await element(by.id('ISLM')).tap();
await element(by.id('Islamic coin')).tap();
await element(by.text('Max')).tap();
await element(by.id(`transaction_sum_next`)).tap();

Expand Down
35 changes: 35 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ platform :android do
aab: 'android/app/build/outputs/bundle/release/app-release.aab'
)
end

lane :submit_latest_to_review do
latest_build_number = google_play_track_version_codes(
package_name: 'com.haqq.wallet',
track: "internal",
json_key: './android/app/google-account.json',
)[0]

deliver(
build_number: latest_build_number,
submit_for_review: true,
automatic_release: false,
force: true, # Skip HTMl report verification
skip_metadata: true,
skip_screenshots: true,
skip_binary_upload: true
)
end
end

platform :ios do
Expand Down Expand Up @@ -238,4 +256,21 @@ platform :ios do

delete_temp_keychain(keychain_name)
end

lane :submit_latest_to_review do
latest_build_number = latest_testflight_build_number(
app_identifier: app_identifier,
api_key: api_key,
)

deliver(
build_number: latest_build_number,
submit_for_review: true,
automatic_release: false,
force: true, # Skip HTMl report verification
skip_metadata: true,
skip_screenshots: true,
skip_binary_upload: true
)
end
end
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '@ethersproject/shims';
import '@walletconnect/react-native-compat';
import {AppRegistry, I18nManager, LogBox} from 'react-native';

import {ENVIRONMENT, SENTRY_DSN, FOR_DETOX} from '@env';
import Config from 'react-native-config';
import {JsonRpcProvider} from '@ethersproject/providers';
import * as Sentry from '@sentry/react-native';
import {name as appName} from './app.json';
Expand Down Expand Up @@ -46,14 +46,14 @@ if (__DEV__ && IS_IOS) {
messaging().setAPNSToken('dev-apns-token', 'sandbox');
}

if (SENTRY_DSN && DEBUG_VARS.enableSentry) {
if (Config.SENTRY_DSN && DEBUG_VARS.enableSentry) {
try {
Sentry.init({
dsn: SENTRY_DSN,
dsn: Config.SENTRY_DSN,
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
tracesSampleRate: 1.0,
environment: ENVIRONMENT ?? 'development',
environment: Config.ENVIRONMENT ?? 'development',
enableWatchdogTerminationTracking: false,
attachScreenshot: true,
attachStacktrace: true,
Expand Down Expand Up @@ -111,4 +111,4 @@ const Wrapped = Sentry.wrap(App);

AppRegistry.registerComponent(appName, () => Wrapped);

AppRegistry.registerComponent('jailbreak', () => FOR_DETOX ? Wrapped : Jailbreak);
AppRegistry.registerComponent('jailbreak', () => Config.FOR_DETOX ? Wrapped : Jailbreak);
10 changes: 10 additions & 0 deletions ios/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Config.xcconfig
// haqq
//
// Created by Nikita Ragozin on 18.03.2024.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
#include? "tmp.xcconfig"
Loading

0 comments on commit 0cb608f

Please sign in to comment.