Skip to content

Commit

Permalink
Upd ci (#1)
Browse files Browse the repository at this point in the history
 Fix tvOS
  • Loading branch information
aromanov91 authored Sep 26, 2024
1 parent e4a07a1 commit 284aa09
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 34 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ name: CI

on:
push:
branches: ["main"]
branches:
- '**'
workflow_dispatch:

jobs:

build-swiftpm:
name: Build SwiftPM
uses: oversizedev/GithubWorkflows/.github/workflows/build-swiftpm.yml@main
strategy:
matrix:
destination:
- platform=iOS Simulator,name=iPhone 16,OS=18.0
- platform=watchOS Simulator,name=Apple Watch SE (40mm) (2nd generation),OS=11.0
- platform=tvOS Simulator,name=Apple TV 4K (3rd generation) (at 1080p),OS=18.0
- platform=macOS,arch=arm64
with:
package: "OversizeRouter"
package: OversizeRouter
destination: ${{ matrix.destination }}
secrets: inherit

# tests:
Expand All @@ -21,7 +30,8 @@ jobs:
# secrets: inherit

bump:
name: Bump version
needs: build-swiftpm
uses: oversizedev/GithubWorkflows/.github/workflows/bump.yml@main
secrets: inherit
name: Bump version
needs: build-swiftpm
if: github.ref == 'refs/heads/main'
uses: oversizedev/GithubWorkflows/.github/workflows/bump.yml@main
secrets: inherit
11 changes: 8 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
import Foundation

let productionDependencies: [PackageDescription.Package.Dependency] = [
let remoteDependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/oversizedev/OversizeUI.git", .upToNextMajor(from: "3.0.2")),
.package(url: "https://github.com/oversizedev/OversizeServices.git", .upToNextMajor(from: "1.4.0")),
.package(url: "https://github.com/oversizedev/OversizeModels.git", .upToNextMajor(from: "0.1.0")),
.package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")),
.package(url: "https://github.com/oversizedev/OversizeLocalizable.git", .upToNextMajor(from: "1.5.0")),
]

let developmentDependencies: [PackageDescription.Package.Dependency] = [
let localDependencies: [PackageDescription.Package.Dependency] = [
.package(name: "OversizeUI", path: "../OversizeUI"),
.package(name: "OversizeServices", path: "../OversizeServices"),
.package(name: "OversizeModels", path: "../OversizeModels"),
.package(name: "OversizeLocalizable", path: "../OversizeLocalizable"),
.package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")),
]

let dependencies: [PackageDescription.Package.Dependency] = developmentDependencies
var dependencies: [PackageDescription.Package.Dependency] = localDependencies

if ProcessInfo.processInfo.environment["BUILD_MODE"] == "PRODUCTION" {
dependencies = remoteDependencies
}

let package = Package(
name: "OversizeRouter",
Expand Down
48 changes: 23 additions & 25 deletions Sources/OversizeRouter/RoutingViews/RoutingSidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,33 @@ public struct RoutingSidebarView<Tab>: View where Tab: TabableView {
}

public var body: some View {
if #available(macOS 15.0, iOS 18.0, *) {
TabView(selection: $router.selection) {
ForEach(router.tabs) { tab in
tab.view()
.tag(tab)
.tabItem {
tab.icon
Text(tab.title)
}
.environment(router)
.environment(hudRouter)
}
}
#if os(iOS) || os(macOS) || os(tvOS) || os(visionOS)
if #available(iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, *) {
tabView
.tabViewStyle(.sidebarAdaptable)
.hud(hudRouter.hudText, isPresented: $hudRouter.isShowHud)
} else {
TabView(selection: $router.selection) {
ForEach(router.tabs) { tab in
tab.view()
.tag(tab)
.tabItem {
tab.icon
Text(tab.title)
}
.environment(router)
.environment(hudRouter)
}
}
tabView
.hud(hudRouter.hudText, isPresented: $hudRouter.isShowHud)
}
#else

tabView
#endif
}

var tabView: some View {
TabView(selection: $router.selection) {
ForEach(router.tabs) { tab in
tab.view()
.tag(tab)
.tabItem {
tab.icon
Text(tab.title)
}
.environment(router)
.environment(hudRouter)
}
}
}
}
8 changes: 8 additions & 0 deletions Sources/OversizeRouter/RoutingViews/RoutingSplitView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public struct RoutingSplitView<TopSidebar, BottomSidebar, Tab>: View where Tab:
}
}
.listStyle(.sidebar)
#elseif os(watchOS) || os(tvOS)
List {
ForEach(router.tabs) { menu in
NavigationLink(value: menu) {
Text(menu.title)
}
}
}
#else
List(selection: $router.selection) {
topSidebar
Expand Down

0 comments on commit 284aa09

Please sign in to comment.