Skip to content

Commit

Permalink
chore: Update to react native 0.72 (#1410)
Browse files Browse the repository at this point in the history
Signed-off-by: Clécio Varjão <[email protected]>
  • Loading branch information
cvarjao authored Sep 29, 2023
1 parent 64d72f7 commit da1e76b
Show file tree
Hide file tree
Showing 40 changed files with 5,234 additions and 3,582 deletions.
92 changes: 73 additions & 19 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ on:
- bifold
- .yarn/**
- .github/workflows/**
- .gitmodules
- package.json
- yarn.lock
- .yarnrc.yml
- .yarn/**

jobs:
check-android-secrets:
Expand Down Expand Up @@ -61,6 +66,15 @@ jobs:
- name: Setup NodeJS
uses: ./.github/workflows/actions/setup-node

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
cache: 'gradle'
server-id: github
settings-path: ${{ github.workspace }}

- name: Configure ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -101,7 +115,7 @@ jobs:
- name: Install dependencies
working-directory: ./
run: |
yarn install --immutable && \
yarn install --immutable && \
git status
# Ledgers are missing namespace, not compatible.
Expand Down Expand Up @@ -172,7 +186,7 @@ jobs:
key: ${{ steps.cache-dd-restore.outputs.cache-primary-key }}

- name: Export development archive
if: github.ref_name == 'main' && needs.check-ios-secrets.outputs.isReleaseBuild == 'true'
#if: github.ref_name == 'main' && needs.check-ios-secrets.outputs.isReleaseBuild == 'true'
uses: ./.github/workflows/actions/export-ios-archive
with:
certificate: ${{ secrets.BUILD_CERTIFICATE_DEV_BASE64 }}
Expand All @@ -182,7 +196,7 @@ jobs:
ouput_artifact_ref: ios-artifact-dev

- name: Export distribution archive
if: github.ref_name == 'main' && needs.check-ios-secrets.outputs.isReleaseBuild == 'true'
#if: github.ref_name == 'main' && needs.check-ios-secrets.outputs.isReleaseBuild == 'true'
uses: ./.github/workflows/actions/export-ios-archive
with:
certificate: ${{ secrets.APPLE_APP_STORE_BUILD_CERTIFICATE_BASE64 }}
Expand All @@ -191,6 +205,17 @@ jobs:
export_options: options.plist
ouput_artifact_ref: ios-artifact

# - name: Publish to GitHub Packages Registry
# run: mvn deploy:deploy-file -s $GITHUB_WORKSPACE/settings.xml -DgroupId=com.github.bcgov -DartifactId=bc-wallet -Dclassifier=ios -DrepositoryId=github -Durl=https://maven.pkg.github.com/$GITHUB_REPOSITORY -Dversion=${{ env.appBuildVersion }}.${{ env.appBuildNumber }} -DgeneratePom=false -Dpackaging=aab -Dfile=export/BCWallet.ipa
# env:
# GITHUB_TOKEN: ${{ github.token }}

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ios
path: export/BCWallet.ipa

# https://blog.codemagic.io/app-store-connect-api-codemagic-cli-tools/
- name: Install Codemagic CLI Tools
if: github.ref_name == 'main' && needs.check-ios-secrets.outputs.isReleaseBuild == 'true'
Expand Down Expand Up @@ -226,6 +251,9 @@ jobs:
build-android:
needs: [check-android-secrets]
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2

Expand All @@ -236,13 +264,24 @@ jobs:
- name: Setup NodeJS
uses: ./.github/workflows/actions/setup-node

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
cache: 'gradle'
server-id: github
settings-path: ${{ github.workspace }}

# Ledgers are missing namespace, not compatible.
# - name: Updaet ledgers
# uses: ./.github/workflows/actions/update-ledgers
- name: Install dependencies
working-directory: ./
run: |
yarn install --immutable && \
rm bifold/package.json && \
rm bifold/yarn.lock && \
yarn install --immutable && \
git status
# Actual environment variables are not being picked up
Expand All @@ -261,18 +300,8 @@ jobs:
echo "IAS_AGENT_INVITE_URL=${IAS_AGENT_INVITE_URL}" >>.env
echo "OCA_URL=${OCA_URL}" >>.env
- name: Android debug build
if: github.ref_name != 'main' || needs.check-android-secrets.outputs.isReleaseBuild != 'true'
working-directory: app/android
env:
VERSION_CODE: ${{ env.appBuildNumber }}
VERSION_NAME: ${{ env.appBuildVersion }}

run: |
./gradlew buildDebug
- name: Create release keystore
if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'
#if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'
working-directory: app/android/app
env:
PLAY_STORE_JKS_BASE64: ${{ secrets.PLAY_STORE_JKS_BASE64 }}
Expand All @@ -283,19 +312,44 @@ jobs:
keytool -list -v -keystore release.keystore -alias ${PLAY_STORE_JKS_ALIAS} -storepass:env PLAY_STORE_JKS_PASSWD | \
grep "SHA1"
# - name: Android debug build
# if: github.ref_name != 'main' || needs.check-android-secrets.outputs.isReleaseBuild != 'true'
# working-directory: app/android
# env:
# VERSION_CODE: ${{ env.appBuildNumber }}
# VERSION_NAME: ${{ env.appBuildVersion }}
# run: |
# ./gradlew --no-daemon bundleRelease

- name: Android release build
if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'
#if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'
working-directory: app/android
env:
PLAY_STORE_JKS_ALIAS: ${{ secrets.PLAY_STORE_JKS_ALIAS }}
PLAY_STORE_JKS_PASSWD: ${{ secrets.PLAY_STORE_JKS_PASSWD }}
VERSION_CODE: ${{ env.appBuildNumber }}
VERSION_NAME: ${{ env.appBuildVersion }}
run: |
cp ../node_modules/react-native-vector-icons/Fonts/* ./app/src/main/assets/fonts/ && \
( cd ../ && npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --verbose ) && \
./gradlew bundleRelease
./gradlew bundleRelease && \
./gradlew assembleRelease && \
find . -type f -name '*.apk'
# - name: Publish to GitHub Packages Registry
# run: mvn deploy:deploy-file -s $GITHUB_WORKSPACE/settings.xml -DgroupId=com.github.bcgov -DartifactId=bc-wallet -Dclassifier=android -DrepositoryId=github -Durl=https://maven.pkg.github.com/$GITHUB_REPOSITORY -Dversion=${{ env.appBuildVersion }}.${{ env.appBuildNumber }} -DgeneratePom=false -Dpackaging=aab -Dfile=app/android/app/build/outputs/bundle/release/app-release.aab
# env:
# GITHUB_TOKEN: ${{ github.token }}
- name: List Artifacts
#if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'
run: |
find . -type f -name '*.apk'
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: android
path: |
app/android/app/build/outputs/bundle/release/app-release.aab
app/android/app/build/outputs/apk/release/app-release.apk
- name: Upload Android artifact
if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'
uses: actions/upload-artifact@v3
Expand Down
13 changes: 0 additions & 13 deletions .yarn/patches/react-native-npm-0.66.5-22e5dd8ec5.patch

This file was deleted.

2 changes: 2 additions & 0 deletions app/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
5 changes: 1 addition & 4 deletions app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useNavigation } from '@react-navigation/native'
import {
Stacks,
Screens,
Agent,
AgentProvider,
TourProvider,
AuthProvider,
Expand Down Expand Up @@ -42,8 +41,6 @@ const App = () => {
useMemo(() => {
initStoredLanguage().then()
}, [])

const [agent] = useState<Agent | undefined>(undefined)
const [surveyVisible, setSurveyVisible] = useState(false)
const { t } = useTranslation()
const { navigate } = useNavigation()
Expand Down Expand Up @@ -110,7 +107,7 @@ const App = () => {

return (
<StoreProvider initialState={initialState} reducer={reducer}>
<AgentProvider agent={agent}>
<AgentProvider>
<ThemeProvider value={theme}>
<ConfigurationProvider value={configuration}>
<AuthProvider>
Expand Down
4 changes: 4 additions & 0 deletions app/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.12'
18 changes: 9 additions & 9 deletions app/__tests__/components/__snapshots__/LoadingIcon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
exports[`LoadingIcon Component renders correctly 1`] = `
<View
collapsable={false}
nativeID="animatedComponent"
style={
Object {
"transform": Array [
Object {
{
"transform": [
{
"rotate": "0deg",
},
],
Expand All @@ -16,21 +15,22 @@ exports[`LoadingIcon Component renders correctly 1`] = `
>
<Text
allowFontScaling={false}
selectable={false}
style={
Array [
Object {
[
{
"color": undefined,
"fontSize": 50,
},
Object {
{
"color": "#333",
},
Object {
{
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
{},
]
}
>
Expand Down
Loading

0 comments on commit da1e76b

Please sign in to comment.