From 346a9d19adfac1bb93a27ac4fe9956df3972b930 Mon Sep 17 00:00:00 2001 From: Michael Jordan Date: Thu, 26 Oct 2023 09:29:31 +0100 Subject: [PATCH 1/3] Web deployment --- .github/web_build.yml | 43 +++++++++++++++++++ .../messages/LinesOfMessagesVisualisation.kt | 2 +- .../imageloader/EmbeddableResourceImage.kt | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/web_build.yml diff --git a/.github/web_build.yml b/.github/web_build.yml new file mode 100644 index 00000000..ec561684 --- /dev/null +++ b/.github/web_build.yml @@ -0,0 +1,43 @@ +name: WebDeployment + +on: + push: + branches: + - setup_deploy_action + +env: + CI: true + +jobs: + WebDeployment: + name: WebDeployment + runs-on: macos-13 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Build with Gradle + run: ./gradlew :webApp:jsBrowserProductionWebpack + + - name: Move Output to Directory + run: | + mkdir distribution + mv webApp/build/dist/js/productionExecutable/* distribution/ + + # Commit and push the directory to a specified branch (e.g., "output-branch") + - name: Commit and Push to Branch + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add distribution/ + git commit -m "Add output from build" + git push -f origin HEAD:deploy-branch \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/com/bumble/livemosaic/appyx/component/messages/LinesOfMessagesVisualisation.kt b/shared/src/commonMain/kotlin/com/bumble/livemosaic/appyx/component/messages/LinesOfMessagesVisualisation.kt index 9c0cb593..128f6292 100644 --- a/shared/src/commonMain/kotlin/com/bumble/livemosaic/appyx/component/messages/LinesOfMessagesVisualisation.kt +++ b/shared/src/commonMain/kotlin/com/bumble/livemosaic/appyx/component/messages/LinesOfMessagesVisualisation.kt @@ -87,7 +87,7 @@ class LinesOfMessagesVisualisation( val mappedHalfEntryHeight = effectiveEntrySize.height / (transitionBounds.heightDp - effectiveEntrySize.height) val horizontalBias = mapValueRange( - value = transitionBounds.widthDp.value / 2f - halfEffectiveEntrySize.width.value * ((elements.size / 2f).nextUp() + value = transitionBounds.widthDp.value / 2f - halfEffectiveEntrySize.width.value * ((elements.size / 2.0).nextUp() .roundToInt()) + index * halfEffectiveEntrySize.width.value, fromRangeMin = 0f, fromRangeMax = transitionBounds.widthDp.value - effectiveEntrySize.width.value, diff --git a/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt b/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt index 15425ee5..80b9be50 100644 --- a/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt +++ b/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale -private const val EMBED_URL = "appyx/where/hosted/sample" +private const val EMBED_URL = "https://github.com/bumble/live-mosaic/blob/deploy-branch/distribution/" @Composable actual fun EmbeddableResourceImage( From 252a164b2548bc939003872d65a706a221ab6289 Mon Sep 17 00:00:00 2001 From: Michael Jordan Date: Thu, 26 Oct 2023 10:46:20 +0100 Subject: [PATCH 2/3] Change to only deploy on main --- .github/web_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/web_build.yml b/.github/web_build.yml index ec561684..3d2619ec 100644 --- a/.github/web_build.yml +++ b/.github/web_build.yml @@ -3,7 +3,7 @@ name: WebDeployment on: push: branches: - - setup_deploy_action + - main env: CI: true From 4773c243daa2b208be2a575f413cee038e64ca8e Mon Sep 17 00:00:00 2001 From: Michael Jordan Date: Thu, 26 Oct 2023 10:48:19 +0100 Subject: [PATCH 3/3] Correct repo name --- .../bumble/livemosaic/imageloader/EmbeddableResourceImage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt b/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt index 80b9be50..ca11a47b 100644 --- a/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt +++ b/shared/src/jsMain/kotlin/com/bumble/livemosaic/imageloader/EmbeddableResourceImage.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale -private const val EMBED_URL = "https://github.com/bumble/live-mosaic/blob/deploy-branch/distribution/" +private const val EMBED_URL = "https://github.com/bumble-tech/live-mosaic/blob/deploy-branch/distribution/" @Composable actual fun EmbeddableResourceImage(