Skip to content

Commit

Permalink
Merge pull request #52 from estivensh4/samples/v0.5.6
Browse files Browse the repository at this point in the history
Samples/v0.5.6
  • Loading branch information
estivensh authored Nov 22, 2023
2 parents 778c5cd + fd5d6f2 commit bcae96a
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 53 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
build-library:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || github.ref != 'refs/heads/doc/*'
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -73,6 +73,7 @@ jobs:
name: code-coverage-report-${{ github.job }}
path: "**/build/reports/**/*"
check-sample-android-app:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand All @@ -84,6 +85,7 @@ jobs:
target: androidapp
githubToken: ${{ secrets.GITHUB_TOKEN }}
check-sample-desktop-app:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand All @@ -95,6 +97,7 @@ jobs:
target: desktopApp
githubToken: ${{ secrets.GITHUB_TOKEN }}
check-sample-wear-app:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand All @@ -106,6 +109,7 @@ jobs:
target: wearapp
githubToken: ${{ secrets.GITHUB_TOKEN }}
check-sample-web-app:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
needs: build-library
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ permissions:

jobs:
build:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
name: Build and analyze
runs-on: self-hosted
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:

jobs:
build-documentation:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -47,6 +48,7 @@ jobs:
retention-days: 7

test-documentation:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
needs: build-documentation
runs-on: ubuntu-latest

Expand All @@ -63,6 +65,7 @@ jobs:
instance: ${{ env.INSTANCE }}

deploy-documentation:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:

jobs:
pre-build:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
name: Publish library at mavenCentral
runs-on: self-hosted
steps:
Expand All @@ -53,6 +54,7 @@ jobs:
- name: Publish library
run: ./gradlew publish --no-parallel
release:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/')
name: Create release v${{ github.event.inputs.version }}
needs: pre-build
runs-on: self-hosted
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ Before [creating an issue](https://github.com/estivensh4/aws-kmp/issues/new), pl

Branching Model
---------------
Development is done with feature branches like `feature/xxx`. Any bug fixes for a particular release should be directed to a release branch such as `release/1.2.x` and from release will be pushed to main. If you want to update the documentation create a branch like docs/xxx.
Development is done with feature branches like `feature/xxx`. Any bug fixes for a particular release should be directed to a release branch like `release/1.2.x` and from the release will be pushed to the main branch. If you want to update the documentation create a branch like `docs/xxx`.

Project members push directly to branches in the main repository. External contributors work on the corresponding branch in their own clone and issue a pull request.
If you want to update only the sample project do it from a branch like `samples/xxx`.

You can, of course, suggest any changes via a pull request, but we suggest that you first create an issue. Creating an issue helps to avoid wasting time.
Project members submit directly to the main repository branches. External contributors work on the corresponding branch in their own clone and issue a pull request.

You can, of course, suggest any changes through a pull request, but we suggest that you first create an issue. Creating an issue helps to avoid wasting time

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext
import com.estivensh4.androidapp.ui.theme.AwskmpTheme
import com.estivensh4.aws_s3.ImageFile
import com.estivensh4.s3.ImageFile
import com.estivensh4.shared.SampleViewModel
import kotlinx.datetime.Clock
import kotlinx.datetime.DateTimeUnit
Expand Down
3 changes: 1 addition & 2 deletions samples/desktopApp/src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand All @@ -21,7 +20,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.window.AwtWindow
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import com.estivensh4.aws_s3.ImageFile
import com.estivensh4.s3.ImageFile
import com.estivensh4.shared.SampleViewModel
import kotlinx.coroutines.launch
import java.awt.FileDialog
Expand Down
2 changes: 1 addition & 1 deletion samples/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
agp = "8.1.4"
awsS3 = "0.5.4"
awsS3 = "0.5.6"
kotlin = "1.9.20"
compose = "1.5.4"
compose-compiler = "1.5.4"
Expand Down
4 changes: 0 additions & 4 deletions samples/iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
14B556C42B02FCD900F83F55 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14B556C32B02FCD900F83F55 /* AppDelegate.swift */; };
14D2717A2B069C5E008E0210 /* KMMViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D271792B069C5E008E0210 /* KMMViewModel.swift */; };
14D2717D2B069CFA008E0210 /* KMMViewModelCore in Frameworks */ = {isa = PBXBuildFile; productRef = 14D2717C2B069CFA008E0210 /* KMMViewModelCore */; };
14D2717F2B069CFA008E0210 /* KMMViewModelSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = 14D2717E2B069CFA008E0210 /* KMMViewModelSwiftUI */; };
Expand All @@ -21,7 +20,6 @@
/* Begin PBXFileReference section */
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
14B556C32B02FCD900F83F55 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
14D271792B069C5E008E0210 /* KMMViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMMViewModel.swift; sourceTree = "<group>"; };
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
6BCC0A48C5FCF9A097A71478 /* 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>"; };
Expand Down Expand Up @@ -80,7 +78,6 @@
7555FF8C242A565B00829871 /* Info.plist */,
2152FB032600AC8F00CF470E /* iOSApp.swift */,
058557D7273AAEEB004C7B11 /* Preview Content */,
14B556C32B02FCD900F83F55 /* AppDelegate.swift */,
14D271792B069C5E008E0210 /* KMMViewModel.swift */,
);
path = iosApp;
Expand Down Expand Up @@ -224,7 +221,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
14B556C42B02FCD900F83F55 /* AppDelegate.swift in Sources */,
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,
14D2717A2B069C5E008E0210 /* KMMViewModel.swift in Sources */,
7555FF83242A565900829871 /* ContentView.swift in Sources */,
Expand Down
33 changes: 0 additions & 33 deletions samples/iosApp/iosApp/AppDelegate.swift

This file was deleted.

2 changes: 1 addition & 1 deletion samples/iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct ContentView: View {

if let selectedImageData,
let uiImage = UIImage(data: selectedImageData) {
sampleViewModel.putObject(bucketName: bucketName, key: key, imageFile: uiImage)
sampleViewModel.putObject(bucketName: bucketName, key: key, imageFile: .init(uiImage: uiImage))
}


Expand Down
15 changes: 15 additions & 0 deletions samples/iosApp/iosApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,20 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>http://s3.us-east-1.amazonaws.com/</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
</dict>
</plist>
2 changes: 0 additions & 2 deletions samples/iosApp/iosApp/iOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import SwiftUI
@main
struct iOSApp: App {

@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate

var body: some Scene {
WindowGroup {
ContentView()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.estivensh4.shared

import com.estivensh4.aws_s3.AWSS3
import com.estivensh4.aws_s3.Bucket
import com.estivensh4.aws_s3.ImageFile
import com.estivensh4.s3.AWSS3
import com.estivensh4.s3.Bucket
import com.estivensh4.s3.ImageFile
import com.rickclephas.kmm.viewmodel.KMMViewModel
import com.rickclephas.kmm.viewmodel.MutableStateFlow
import com.rickclephas.kmp.nativecoroutines.NativeCoroutinesState
Expand All @@ -28,7 +28,7 @@ open class SampleViewModel : KMMViewModel() {
@NativeCoroutinesState
val generatePresignedUrl get() = _generatePresignedUrl.asStateFlow()

private val client = AWSS3.Builder()
private val client = AWSS3.builder()
.accessKey(BuildPublicConfig.accessKey)
.secretKey(BuildPublicConfig.secretKey)
.setEndpoint("s3.amazonaws.com")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import androidx.wear.compose.material.ScalingLazyColumn
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.TimeText
import androidx.wear.compose.material.rememberScalingLazyListState
import com.estivensh4.aws_s3.ImageFile
import com.estivensh4.s3.ImageFile
import com.estivensh4.shared.SampleViewModel
import com.estivensh4.wearapp.presentation.theme.ExampleTheme
import kotlinx.datetime.Clock
Expand Down

0 comments on commit bcae96a

Please sign in to comment.