Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Prepare ios ci (#42)
Browse files Browse the repository at this point in the history
* feat: update ios app icon and bundle name

* Implement system back button handling

* Migrate to local resources for app icon

* ci: remove test branch

* Add exports

* ci: run

* Try build xcarhive

* add pod insatll

* try gradlew

* add java
gp

* Add build ipa

* Add provisit updates

* Remove allow to update

* Change key

* commit

* Try deploy to test fly

* Change export option for ios project

* Ci: try new export options

* Separate build xcarhive and ipa

* ci: trigger

* Try new export file

* Try xcrun

* try new export
g

* Try new ci file

* remove cd

* fixed ls commands

* Fixed export option path

* try new export option

* try ad hoc

* Remove method

* Try new ci

* try method ad hoc

* Try deploy to test flight

* fix upload to test flight for xcode 13

* Remove comments

* fixed style

* Try version change

* Merge android and ios ci

* Try without java action

* fix: pull requset ci
  • Loading branch information
VovaStelmashchuk authored Apr 24, 2023
1 parent e0b6052 commit b7174d3
Show file tree
Hide file tree
Showing 26 changed files with 161 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Publish Android Nightly build
on:
push:
branches:
- setup_release_ci
- main
workflow_dispatch:


jobs:
prepare_deploy:
runs-on: ubuntu-22.04
steps:
- name: "checkout"
- name: "Checkout"
uses: actions/checkout@v3
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
Expand Down Expand Up @@ -44,14 +43,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup Gradle
- name: "Setup Gradle"
uses: gradle/gradle-build-action@v2

- name: Build bundle release
- name: "Build bundle release"
run: gradle android:bundleRelease

- uses: r0adkll/sign-android-release@v1
name: Sign app aab file
name: "Sign app aab file"
id: sign_app
with:
releaseDirectory: androidApp/build/outputs/bundle/release
Expand All @@ -64,7 +63,7 @@ jobs:

- uses: actions/upload-artifact@v2
with:
name: Aab file
name: "Upload AAB file as artifact"
path: ${{steps.sign_app.outputs.signedReleaseFile}}

- name: "Upload to Google Play"
Expand All @@ -75,3 +74,60 @@ jobs:
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}}
track: beta
status: completed

deploy_ios:
needs: [ prepare_deploy ]
env:
MIXDRINKS_MOBILE_APP_VERSION_NAME: ${{ needs.prepare_deploy.outputs.output_write_mix_drinks_mobile_version_name }}
MIXDRINKS_MOBILE_APP_VERSION_CODE: ${{ needs.prepare_deploy.outputs.output_write_mix_drinks_mobile_version_code }}
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: "Setup Gradle"
uses: gradle/gradle-build-action@v2

- name: "Build xcworkspace"
run: ./gradlew podInstall

- name: "Setup app version"
uses: yanamura/ios-bump-version@v1
with:
version: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_NAME }}
build-number: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_CODE }}
project-path: iosApp

- name: "Build IOS App"
uses: yukiarrr/[email protected]
with:
project-path: iosApp/iosApp.xcodeproj
p12-base64: ${{ secrets.MIXDRINKS_IOS_P12_BASE64 }}
mobileprovision-base64: ${{ secrets.MIXDRINKS_IOS_BUILD_PROVISION_PROFILE_BASE64 }}
code-signing-identity: "iPhone Distribution"
team-id: ${{ secrets.MIXDRINKS_IOS_TEAM_ID }}
certificate-password: ${{ secrets.MIXDRINKS_IOS_CERTIFICATE_PASSWORD }}
workspace-path: iosApp/iosApp.xcworkspace
export-method: "ad-hoc"
- name: "Upload IPA file as artifact"
uses: actions/upload-artifact@v2
with:
name: IOS IPA
path: "output.ipa"

- name: Install private API key P8
env:
PRIVATE_API_KEY_BASE64: ${{ secrets.MIXDRINKS_IOS_APPSTORE_API_PRIVATE_KEY }}
API_KEY: ${{ secrets.MIXDRINKS_IOS_APPSTORE_API_KEY_ID }}
run: |
mkdir -p ~/private_keys
echo -n "$PRIVATE_API_KEY_BASE64" | base64 --decode --output ~/private_keys/AuthKey_$API_KEY.p8
- name: "Upload IPA file to test flight"
env:
API_KEY: ${{ secrets.MIXDRINKS_IOS_APPSTORE_API_KEY_ID }}
API_ISSUER: ${{ secrets.MIXDRINKS_IOS_APPSTORE_ISSUER_ID }}
run: xcrun altool --output-format xml --upload-app -f output.ipa -t ios --apiKey $API_KEY --apiIssuer $API_ISSUER
20 changes: 11 additions & 9 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ jobs:
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Execute Gradle build
run: gradle check
java-version: '11'
distribution: 'adopt'
architecture: x64
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Build with Gradle
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: check
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.iml
*.iml
.gradle
/local.properties
/.idea
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,25 @@ Gradle

### Contributing

Автор проекту буде радий будь-якій допомозі.
Автор проекту буде радий будь-якій допомозі.

Нотатки про для розробників що будуть робити зміни в проекті:
- Якщо ваші зміни в код відбуваються в файлі `iosApp/Configuration/Config.xcconfig` то закрийте
Android studio та зробіть зміни в іншому редакторі, далі запустіть `./cleanup.sh` після чого проект
знову можна відкривати в Android Studio.
Нотатки про для розробників що будуть робити зміни в проекті:

#### Config.xcconfig

- Якщо ваші зміни в код відбуваються в файлі `iosApp/Configuration/Config.xcconfig` то закрийте
Android studio та зробіть зміни в іншому редакторі, далі запустіть `./cleanup.sh` після чого
проект
знову можна відкривати в Android Studio.

```shell
./cleanup.sh
```

#### Робота з ресурсами

Після змін в ресурсах необхідно в `iosApp` запустити `pod install` щоб згенерувати нові файли.

```shell
pod install
```
2 changes: 1 addition & 1 deletion iosApp/Configuration/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TEAM_ID=9LJW42P73L
BUNDLE_ID=com.myapplication.MyApplication
BUNDLE_ID=org.mixdrinks.app
APP_NAME=MixDrinks
42 changes: 32 additions & 10 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -20,7 +20,7 @@
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = "<group>"; };
6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF7B242A565900829871 /* MixDrinks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MixDrinks.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -69,7 +69,7 @@
7555FF7C242A565900829871 /* Products */ = {
isa = PBXGroup;
children = (
7555FF7B242A565900829871 /* iosApp.app */,
7555FF7B242A565900829871 /* MixDrinks.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -122,7 +122,7 @@
);
name = iosApp;
productName = iosApp;
productReference = 7555FF7B242A565900829871 /* iosApp.app */;
productReference = 7555FF7B242A565900829871 /* MixDrinks.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -349,21 +349,32 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "${TEAM_ID}";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9LJW42P73L;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MixDrinks;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.food-and-drink";
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = org.mixdrinks.app9LJW42P73L;
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = InternalTestv1;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
Expand All @@ -373,21 +384,32 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "${TEAM_ID}";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 9LJW42P73L;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MixDrinks;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.food-and-drink";
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = org.mixdrinks.app9LJW42P73L;
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = InternalTestv1;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
Expand Down
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/58.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/87.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
"author": "xcode",
"version": 1
}
}
}
8 changes: 7 additions & 1 deletion shared/src/androidMain/kotlin/main.android.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import com.arkivanov.decompose.defaultComponentContext
import org.mixdrinks.app.MixDrinksApp

@Composable
fun MainView() = MixDrinksApp()
fun MainView() {
val context = (LocalContext.current as AppCompatActivity).defaultComponentContext()
MixDrinksApp(context)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ package org.mixdrinks.app
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import com.arkivanov.decompose.DefaultComponentContext
import com.arkivanov.essenty.lifecycle.LifecycleRegistry
import org.mixdrinks.ui.RootComponent
import org.mixdrinks.ui.RootContent

@Composable
internal fun MixDrinksApp() {
internal fun MixDrinksApp(contextComponent: DefaultComponentContext) {
val rootComponent = remember {
val lifecycle = LifecycleRegistry()
RootComponent(DefaultComponentContext(lifecycle))
RootComponent(contextComponent)
}
RootContent(rootComponent)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.seiko.imageloader.rememberAsyncImagePainter
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import org.mixdrinks.app.styles.MixDrinksColors
import org.mixdrinks.app.styles.MixDrinksTextStyles
import org.mixdrinks.ui.details.goods.GoodsView
Expand All @@ -51,6 +53,7 @@ internal fun DetailView(component: DetailsComponent) {
}
}

@OptIn(ExperimentalResourceApi::class)
@Composable
internal fun DetailViewContent(cocktail: FullCocktailUiModel, component: DetailsComponent) {
Column {
Expand All @@ -71,7 +74,7 @@ internal fun DetailViewContent(cocktail: FullCocktailUiModel, component: Details
.align(Alignment.Center)
.size(32.dp)
.padding(start = 12.dp),
painter = rememberAsyncImagePainter("https://image.mixdrinks.org/icons%2Fback.png"),
painter = painterResource("ic_arrow_back.xml"),
contentDescription = "Test"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.seiko.imageloader.rememberAsyncImagePainter
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource
import org.mixdrinks.app.styles.MixDrinksColors
import org.mixdrinks.app.styles.MixDrinksTextStyles
import org.mixdrinks.app.utils.ResString
Expand All @@ -38,6 +40,7 @@ import org.mixdrinks.ui.filters.FilterItem
import org.mixdrinks.ui.widgets.undomain.ContentHolder
import org.mixdrinks.ui.widgets.undomain.FlowRow

@OptIn(ExperimentalResourceApi::class)
@Composable
internal fun CocktailListView(component: ListComponent) {
Column(
Expand All @@ -63,7 +66,7 @@ internal fun CocktailListView(component: ListComponent) {
modifier = Modifier
.align(Alignment.Center)
.size(32.dp),
painter = rememberAsyncImagePainter("https://image.mixdrinks.org/icons%2Ffilter.svg"),
painter = painterResource("ic_filter.xml"),
contentDescription = ResString.filters,
colorFilter = ColorFilter.tint(Color.White)
)
Expand Down
24 changes: 0 additions & 24 deletions shared/src/commonMain/resources/compose-multiplatform.xml

This file was deleted.

Loading

0 comments on commit b7174d3

Please sign in to comment.