Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release workflow #2668

Merged
merged 7 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions .github/actions/publish-artifacts/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
module.exports = {
extends: [require.resolve('@sd/config/eslint/base.js')],
root: true,
env: {
'node': true,
'es2022': true,
'browser': false,
'commonjs': false,
'shared-node-browser': false
},
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'standard',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:prettier/recommended'
],
plugins: ['@typescript-eslint'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
project: true
},
ignorePatterns: ['dist/**/*']
ignorePatterns: ['node_modules/**/*', 'dist/**/*']
};
4 changes: 2 additions & 2 deletions .github/actions/publish-artifacts/dist/index.js

Large diffs are not rendered by default.

33 changes: 23 additions & 10 deletions .github/actions/publish-artifacts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ import { exists } from '@actions/io/lib/io-util';

type OS = 'darwin' | 'windows' | 'linux';
type Arch = 'x64' | 'arm64';
type TargetConfig = { bundle: string; ext: string };
type BuildTarget = {

interface TargetConfig {
ext: string;
bundle: string;
}

interface BuildTarget {
updater: false | { bundle: string; bundleExt: string; archiveExt: string };
standalone: Array<TargetConfig>;
};
standalone: TargetConfig[];
}

const OS_TARGETS = {
darwin: {
Expand All @@ -36,8 +41,8 @@ const OS_TARGETS = {
} satisfies Record<OS, BuildTarget>;

// Workflow inputs
const OS: OS = core.getInput('os') as any;
const ARCH: Arch = core.getInput('arch') as any;
const OS = core.getInput('os') as OS;
const ARCH = core.getInput('arch') as Arch;
const TARGET = core.getInput('target');
const PROFILE = core.getInput('profile');

Expand All @@ -59,7 +64,11 @@ async function uploadFrontend() {
return;
}

await client.uploadArtifact(FRONTEND_ARCHIVE_NAME, [FRONT_END_BUNDLE], 'apps/desktop');
const artifactName = `${FRONTEND_ARCHIVE_NAME}.tar.xz`;
const artifactPath = `${ARTIFACTS_DIR}/${artifactName}`;

await io.cp(FRONT_END_BUNDLE, artifactPath);
await client.uploadArtifact(artifactName, [artifactPath], ARTIFACTS_DIR);
}

async function uploadUpdater(updater: BuildTarget['updater']) {
Expand All @@ -69,7 +78,7 @@ async function uploadUpdater(updater: BuildTarget['updater']) {
const files = await globFiles(`${BUNDLE_DIR}/${bundle}/*.${fullExt}*`);

const updaterPath = files.find((file) => file.endsWith(fullExt));
if (!updaterPath) throw new Error(`Updater path not found. Files: ${files}`);
if (!updaterPath) throw new Error(`Updater path not found. Files: ${files.join(',')}`);

const artifactPath = `${ARTIFACTS_DIR}/${UPDATER_ARTIFACT_NAME}.${archiveExt}`;

Expand All @@ -88,7 +97,7 @@ async function uploadStandalone({ bundle, ext }: TargetConfig) {
const files = await globFiles(`${BUNDLE_DIR}/${bundle}/*.${ext}*`);

const standalonePath = files.find((file) => file.endsWith(ext));
if (!standalonePath) throw new Error(`Standalone path not found. Files: ${files}`);
if (!standalonePath) throw new Error(`Standalone path not found. Files: ${files.join(',')}`);

const artifactName = `${ARTIFACT_BASE}.${ext}`;
const artifactPath = `${ARTIFACTS_DIR}/${artifactName}`;
Expand All @@ -108,4 +117,8 @@ async function run() {
...standalone.map((config) => uploadStandalone(config))
]);
}
run();

run().catch((error: unknown) => {
console.error(error);
process.exit(1);
});
7 changes: 3 additions & 4 deletions .github/actions/publish-artifacts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
"lint": "eslint . --cache"
},
"dependencies": {
"@actions/artifact": "^2.1.7",
"@actions/artifact": "^2.1.9",
"@actions/core": "^1.10.1",
"@actions/glob": "^0.4.0",
"@actions/glob": "^0.5.0",
"@actions/io": "^1.1.3"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"@sd/config": "workspace:*"
"@vercel/ncc": "^0.38.1"
}
}
36 changes: 27 additions & 9 deletions .github/actions/publish-artifacts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
{
"compilerOptions": {
"target": "es2015" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "esnext" /* Specify what module code is generated. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"noEmit": true
}
"lib": ["esnext"],
"noEmit": true,
"strict": true,
"module": "esnext",
"target": "esnext",
"declaration": false,
"incremental": true,
"skipLibCheck": true,
"removeComments": false,
"noUnusedLocals": true,
"isolatedModules": true,
"esModuleInterop": true,
"disableSizeLimit": true,
"moduleResolution": "node",
"noImplicitReturns": true,
"resolveJsonModule": true,
"noUnusedParameters": true,
"experimentalDecorators": true,
"useDefineForClassFields": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"noPropertyAccessFromIndexSignature": false
},
"include": ["./**/*.ts"],
"exclude": ["dist", "node_modules"],
"$schema": "https://json.schemastore.org/tsconfig"
}
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- '.github/workflows/release.yml'
- '.github/actions/publish-artifacts/**'
workflow_dispatch:

# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21
Expand All @@ -19,12 +20,12 @@ jobs:
settings:
- host: macos-13
target: x86_64-apple-darwin
bundles: app,dmg
bundles: dmg,app
os: darwin
arch: x86_64
- host: macos-14
target: aarch64-apple-darwin
bundles: app,dmg
bundles: dmg,app
os: darwin
arch: aarch64
- host: windows-latest
Expand Down Expand Up @@ -101,7 +102,7 @@ jobs:

- name: Build
run: |
pnpm tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }},updater
pnpm tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
Expand Down Expand Up @@ -141,7 +142,7 @@ jobs:

- name: Create Release
# TODO: Change to stable version when available
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
uses: softprops/action-gh-release@v2
with:
draft: true
files: '*/**'
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
'^[./]'
],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators'],
importOrderTypeScriptVersion: '4.4.0',
importOrderTypeScriptVersion: '5.0.0',
tailwindConfig: './packages/ui/tailwind.config.js',
plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss']
};
16 changes: 13 additions & 3 deletions apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"category": "Productivity",
"shortDescription": "Spacedrive",
"longDescription": "Cross-platform universal file explorer, powered by an open-source virtual distributed filesystem.",
"createUpdaterArtifacts": "v1Compatible",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
Expand All @@ -66,7 +67,18 @@
"minimumSystemVersion": "10.15",
"exceptionDomain": null,
"entitlements": null,
"frameworks": ["../../.deps/Spacedrive.framework"]
"frameworks": ["../../.deps/Spacedrive.framework"],
"dmg": {
"background": "dmg-background.png",
"appPosition": {
"x": 190,
"y": 190
},
"applicationFolderPosition": {
"x": 470,
"y": 190
}
}
},
"windows": {
"certificateThumbprint": null,
Expand All @@ -84,8 +96,6 @@
},
"plugins": {
"updater": {
"active": true,
"dialog": false,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEZBMURCMkU5NEU3NDAyOEMKUldTTUFuUk82YklkK296dlkxUGkrTXhCT3ZMNFFVOWROcXNaS0RqWU1kMUdRV2tDdFdIS0Y3YUsK",
"endpoints": [
"https://spacedrive.com/api/releases/tauri/{{version}}/{{target}}/{{arch}}"
Expand Down
3 changes: 1 addition & 2 deletions apps/mobile/src/navigation/DrawerNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import DrawerContent from '~/components/drawer/DrawerContent';
import { tw } from '~/lib/tailwind';

import type { RootStackParamList } from '.';
import type { TabParamList } from './TabNavigator';
import TabNavigator from './TabNavigator';
import TabNavigator, { type TabParamList } from './TabNavigator';

const Drawer = createDrawerNavigator<DrawerNavParamList>();

Expand Down
3 changes: 1 addition & 2 deletions interface/app/$libraryId/Explorer/DragOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ClientRect, Modifier } from '@dnd-kit/core';
import { DragOverlay as DragOverlayPrimitive } from '@dnd-kit/core';
import { DragOverlay as DragOverlayPrimitive, type ClientRect, type Modifier } from '@dnd-kit/core';
import { getEventCoordinates } from '@dnd-kit/utilities';
import clsx from 'clsx';
import { memo, useEffect, useRef } from 'react';
Expand Down
20 changes: 11 additions & 9 deletions interface/app/$libraryId/Explorer/useExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import { useCallback, useEffect, useMemo, useRef, useState, type RefObject } fro
import { useDebouncedCallback } from 'use-debounce';
import { proxy, snapshot, subscribe, useSnapshot } from 'valtio';
import { z } from 'zod';
import type {
ExplorerItem,
ExplorerLayout,
ExplorerSettings,
FilePath,
Location,
NodeState,
Tag
import {
ObjectKindEnum,
type ExplorerItem,
type ExplorerLayout,
type ExplorerSettings,
type FilePath,
type Location,
type NodeState,
type Ordering,
type OrderingKeys,
type Tag
} from '@sd/client';
import { ObjectKindEnum, type Ordering, type OrderingKeys } from '@sd/client';

import { createDefaultExplorerSettings } from './store';
import { uniqueId } from './util';
Expand Down
8 changes: 6 additions & 2 deletions packages/client/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { QueryClient } from '@tanstack/react-query';
import { useMemo } from 'react';

import type { Object } from '..';
import type { ExplorerItem, FilePath, NonIndexedPathItem } from '../core';
import { LibraryConfigWrapped } from '../core';
import {
LibraryConfigWrapped,
type ExplorerItem,
type FilePath,
type NonIndexedPathItem
} from '../core';

export * from './jobs';

Expand Down
27 changes: 12 additions & 15 deletions pnpm-lock.yaml

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

Loading
Loading