Skip to content

Commit

Permalink
Merge branch 'spacedriveapp:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Isratja45 committed Jul 20, 2023
2 parents 6a0fb2f + 8d6a060 commit fa9ceae
Show file tree
Hide file tree
Showing 140 changed files with 5,932 additions and 2,966 deletions.
8 changes: 7 additions & 1 deletion .github/scripts/setup-system.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ https://learn.microsoft.com/windows/package-manager/winget/
'@
}

# TODO: Check system winget version is greater or equal to v1.4.10052
# Check system winget version is greater or equal to v1.4.10052
$wingetVersion = [Version]((winget --version) -replace '.*?(\d+)\.(\d+)\.(\d+).*', '$1.$2.$3')
$requiredVersion = [Version]'1.4.10052'
if ($wingetVersion.CompareTo($requiredVersion) -lt 0) {
$errorMessage = "You need to update your winget to version $requiredVersion or higher."
Exit-WithError $errorMessage
}

# Check connectivity to GitHub
$ProgressPreference = 'SilentlyContinue'
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ jobs:
with:
filters: |
changes:
- 'apps/cli/*/**'
- 'apps/desktop/crates/*/**'
- 'apps/desktop/src-tauri/*/**'
- 'apps/mobile/crates/*/**'
- 'apps/server/*/**'
- 'core/**'
- 'crates/*/**'
- 'extensions/*/**'
- 'Cargo.toml'
- 'Cargo.lock'
- name: Setup Rust and Prisma
if: steps.filter.outputs.changes == 'true'
Expand All @@ -81,8 +89,16 @@ jobs:
with:
filters: |
changes:
- 'apps/cli/*/**'
- 'apps/desktop/crates/*/**'
- 'apps/desktop/src-tauri/*/**'
- 'apps/mobile/crates/*/**'
- 'apps/server/*/**'
- 'core/**'
- 'crates/*/**'
- 'extensions/*/**'
- 'Cargo.toml'
- 'Cargo.lock'
- name: Setup System and Rust
if: steps.filter.outputs.changes == 'true'
Expand Down
76 changes: 38 additions & 38 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,49 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
platforms: linux/amd64
driver-opts: |
image=moby/buildkit:master
network=host
- name: Update buildah
shell: bash
run: |
wget -O- 'https://github.com/nicholasdille/buildah-static/releases/download/v1.30.0/buildah-amd64.tar.gz' \
| sudo tar -xzf- -C /usr/
- name: Determine image name & tag
id: image_info
shell: bash
run: |
if [ "$GITHUB_EVENT_NAME" == "release" ]; then
export IMAGE_TAG=${GITHUB_REF##*/}
IMAGE_TAG=${GITHUB_REF##*/}
else
export IMAGE_TAG=$(git rev-parse --short "$GITHUB_SHA")
IMAGE_TAG=$(git rev-parse --short "$GITHUB_SHA")
fi
export GITHUB_REPOSITORY_LOWER=$(echo $GITHUB_REPOSITORY | awk '{print tolower($0)}')
export IMAGE_NAME="ghcr.io/$GITHUB_REPOSITORY_LOWER/server"
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
echo "Building $IMAGE_NAME:$IMAGE_TAG"
- name: Build Docker image
shell: bash
run: |
docker build ./apps/server/docker --tag $IMAGE_NAME:$IMAGE_TAG --build-arg="REPO=${GITHUB_REPOSITORY}" --build-arg="REPO_REF=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
- name: Push Docker image
shell: bash
run: |
docker push $IMAGE_NAME:$IMAGE_TAG
GITHUB_REPOSITORY_LOWER=$(echo $GITHUB_REPOSITORY | awk '{print tolower($0)}')
IMAGE_NAME="ghcr.io/$GITHUB_REPOSITORY_LOWER/server"
- name: Tag & push image as latest staging image
if: ${{ github.event_name != 'release' }}
shell: bash
run: |
docker tag $IMAGE_NAME:$IMAGE_TAG $IMAGE_NAME:staging
docker push $IMAGE_NAME:staging
- name: Tag & push image as latest production image
if: ${{ github.event_name == 'release' }}
shell: bash
run: |
docker tag $IMAGE_NAME:$IMAGE_TAG $IMAGE_NAME:production
docker push $IMAGE_NAME:production
echo "Building $IMAGE_NAME:$IMAGE_TAG"
echo "tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
echo "name=${IMAGE_NAME}" >> $GITHUB_OUTPUT
echo "repo=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
echo "repo_ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Build image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
tags: ${{ steps.image_info.outputs.tag }} ${{ github.event_name == 'release' && 'production' || 'staging' }}
archs: amd64
image: ${{ steps.image_info.outputs.name }}
context: ./apps/server/docker
build-args: |
REPO=${{ steps.image_info.outputs.repo }}
REPO_REF=${{ steps.image_info.outputs.repo_ref }}
containerfiles: |
./apps/server/docker/Dockerfile
- name: Push image to ghcr.io
uses: redhat-actions/push-to-registry@v2
with:
tags: ${{ steps.build-image.outputs.tags }}
image: ${{ steps.build-image.outputs.image }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ yalc.lock
todos.md
examples/*/*.lock
/target
prisma*.rs

playwright-report

Expand Down
44 changes: 38 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ edition = "2021"
repository = "https://github.com/spacedriveapp/spacedrive"

[workspace.dependencies]
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "e0af63224dcdb00a14c0aeade878894be8304cfc", features = [
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "047c1102284a61ee400788baa7529d54ae745790", features = [
"rspc",
"sqlite-create-many",
"migrations",
"sqlite",
], default-features = false }
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "e0af63224dcdb00a14c0aeade878894be8304cfc", features = [
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "047c1102284a61ee400788baa7529d54ae745790", features = [
"rspc",
"sqlite-create-many",
"migrations",
"sqlite",
], default-features = false }
prisma-client-rust-sdk = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "e0af63224dcdb00a14c0aeade878894be8304cfc", features = [
prisma-client-rust-sdk = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "047c1102284a61ee400788baa7529d54ae745790", features = [
"sqlite",
], default-features = false }

Expand Down
3 changes: 2 additions & 1 deletion apps/desktop/src-tauri/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ pub async fn reveal_items(
.db
.location()
.find_many(vec![
location::node_id::equals(Some(library.node_local_id)),
// TODO(N): This will fall apart with removable media and is making an invalid assumption that the `Node` is fixed for an `Instance`.
location::instance_id::equals(Some(library.config.instance_id)),
location::id::in_vec(locations),
])
.select(location::select!({ path }))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
import type { Adapter } from '@auth/core/adapters';
import { and, eq } from 'drizzle-orm';
// @ts-expect-error
import { v4 as uuid } from 'uuid';
import type { DbClient, Schema } from './schema';

Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/TeamMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function TeamMember(props: TeamMemberProps) {
alt={`Portrait of ${props.name}`}
width={size}
height={size}
className={clsx('m-0 inline-flex rounded-md', {
className={clsx('m-0 inline-flex rounded-md object-cover', {
'!xs:w-36 !xs:h-36 !sm:w-40 !sm:h-40 h-32 w-32': !props.investmentRound,
'lg:h-28 lg:w-28': props.investmentRound
})}
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@tanstack/react-query": "^4.29.1",
"class-variance-authority": "^0.5.3",
"dayjs": "^1.11.8",
"event-target-polyfill": "^0.0.3",
"expo": "~48.0.19",
"expo-linking": "~4.0.1",
"expo-media-library": "~15.2.3",
Expand Down
10 changes: 9 additions & 1 deletion apps/mobile/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { useSnapshot } from 'valtio';
import {
ClientContextProvider,
LibraryContextProvider,
NotificationContextProvider,
P2PContextProvider,
RspcProvider,
initPlausible,
useClientContext,
Expand All @@ -30,6 +32,7 @@ import { useTheme } from './hooks/useTheme';
import { changeTwTheme, tw } from './lib/tailwind';
import RootNavigator from './navigation';
import OnboardingNavigator from './navigation/OnboardingNavigator';
import { P2P } from './screens/p2p';
import { currentLibraryStore } from './utils/nav';

dayjs.extend(advancedFormat);
Expand Down Expand Up @@ -111,7 +114,12 @@ function AppContainer() {
<BottomSheetModalProvider>
<StatusBar style="light" />
<ClientContextProvider currentLibraryId={id}>
<AppNavigation />
<P2PContextProvider>
<P2P />
<NotificationContextProvider>
<AppNavigation />
</NotificationContextProvider>
</P2PContextProvider>
</ClientContextProvider>
</BottomSheetModalProvider>
</MenuProvider>
Expand Down
Loading

0 comments on commit fa9ceae

Please sign in to comment.