Skip to content

Commit ba0ecb6

Browse files
Fix release workflow (#2668)
* Fix frontend bundle upload - Update pnpm * Revert incorrect removal of fontenf packaging job * Fix tauri not building updater bundles * Ensure release action is executed when PRs modify the publish-artifacts action * Fix unused argument for patchTauri function * Couple for format fixes * tauri requires building the app bundle to build the updater
1 parent 58c986b commit ba0ecb6

File tree

15 files changed

+129
-99
lines changed

15 files changed

+129
-99
lines changed
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
module.exports = {
2-
extends: [require.resolve('@sd/config/eslint/base.js')],
2+
root: true,
3+
env: {
4+
'node': true,
5+
'es2022': true,
6+
'browser': false,
7+
'commonjs': false,
8+
'shared-node-browser': false
9+
},
10+
parser: '@typescript-eslint/parser',
11+
extends: [
12+
'eslint:recommended',
13+
'standard',
14+
'plugin:@typescript-eslint/strict-type-checked',
15+
'plugin:@typescript-eslint/stylistic-type-checked',
16+
'plugin:prettier/recommended'
17+
],
18+
plugins: ['@typescript-eslint'],
319
parserOptions: {
4-
tsconfigRootDir: __dirname,
5-
project: './tsconfig.json'
20+
project: true
621
},
7-
ignorePatterns: ['dist/**/*']
22+
ignorePatterns: ['node_modules/**/*', 'dist/**/*']
823
};

.github/actions/publish-artifacts/dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/publish-artifacts/index.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ import { exists } from '@actions/io/lib/io-util';
66

77
type OS = 'darwin' | 'windows' | 'linux';
88
type Arch = 'x64' | 'arm64';
9-
type TargetConfig = { bundle: string; ext: string };
10-
type BuildTarget = {
9+
10+
interface TargetConfig {
11+
ext: string;
12+
bundle: string;
13+
}
14+
15+
interface BuildTarget {
1116
updater: false | { bundle: string; bundleExt: string; archiveExt: string };
12-
standalone: Array<TargetConfig>;
13-
};
17+
standalone: TargetConfig[];
18+
}
1419

1520
const OS_TARGETS = {
1621
darwin: {
@@ -36,8 +41,8 @@ const OS_TARGETS = {
3641
} satisfies Record<OS, BuildTarget>;
3742

3843
// Workflow inputs
39-
const OS: OS = core.getInput('os') as any;
40-
const ARCH: Arch = core.getInput('arch') as any;
44+
const OS = core.getInput('os') as OS;
45+
const ARCH = core.getInput('arch') as Arch;
4146
const TARGET = core.getInput('target');
4247
const PROFILE = core.getInput('profile');
4348

@@ -59,7 +64,11 @@ async function uploadFrontend() {
5964
return;
6065
}
6166

62-
await client.uploadArtifact(FRONTEND_ARCHIVE_NAME, [FRONT_END_BUNDLE], 'apps/desktop');
67+
const artifactName = `${FRONTEND_ARCHIVE_NAME}.tar.xz`;
68+
const artifactPath = `${ARTIFACTS_DIR}/${artifactName}`;
69+
70+
await io.cp(FRONT_END_BUNDLE, artifactPath);
71+
await client.uploadArtifact(artifactName, [artifactPath], ARTIFACTS_DIR);
6372
}
6473

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

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

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

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

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

93102
const artifactName = `${ARTIFACT_BASE}.${ext}`;
94103
const artifactPath = `${ARTIFACTS_DIR}/${artifactName}`;
@@ -108,4 +117,8 @@ async function run() {
108117
...standalone.map((config) => uploadStandalone(config))
109118
]);
110119
}
111-
run();
120+
121+
run().catch((error: unknown) => {
122+
console.error(error);
123+
process.exit(1);
124+
});

.github/actions/publish-artifacts/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
"lint": "eslint . --cache"
88
},
99
"dependencies": {
10-
"@actions/artifact": "^2.1.7",
10+
"@actions/artifact": "^2.1.9",
1111
"@actions/core": "^1.10.1",
12-
"@actions/glob": "^0.4.0",
12+
"@actions/glob": "^0.5.0",
1313
"@actions/io": "^1.1.3"
1414
},
1515
"devDependencies": {
16-
"@vercel/ncc": "^0.38.1",
17-
"@sd/config": "workspace:*"
16+
"@vercel/ncc": "^0.38.1"
1817
}
1918
}
Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
{
22
"compilerOptions": {
3-
"target": "es2015" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
4-
"module": "esnext" /* Specify what module code is generated. */,
5-
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
6-
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
7-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
8-
"strict": true /* Enable all strict type-checking options. */,
9-
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
10-
"noEmit": true
11-
}
3+
"lib": ["esnext"],
4+
"noEmit": true,
5+
"strict": true,
6+
"module": "esnext",
7+
"target": "esnext",
8+
"declaration": false,
9+
"incremental": true,
10+
"skipLibCheck": true,
11+
"removeComments": false,
12+
"noUnusedLocals": true,
13+
"isolatedModules": true,
14+
"esModuleInterop": true,
15+
"disableSizeLimit": true,
16+
"moduleResolution": "node",
17+
"noImplicitReturns": true,
18+
"resolveJsonModule": true,
19+
"noUnusedParameters": true,
20+
"experimentalDecorators": true,
21+
"useDefineForClassFields": true,
22+
"noUncheckedIndexedAccess": true,
23+
"exactOptionalPropertyTypes": true,
24+
"forceConsistentCasingInFileNames": true,
25+
"noPropertyAccessFromIndexSignature": false
26+
},
27+
"include": ["./**/*.ts"],
28+
"exclude": ["dist", "node_modules"],
29+
"$schema": "https://json.schemastore.org/tsconfig"
1230
}

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- '.github/workflows/release.yml'
7+
- '.github/actions/publish-artifacts/**'
78
workflow_dispatch:
89

910
# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21
@@ -19,12 +20,12 @@ jobs:
1920
settings:
2021
- host: macos-13
2122
target: x86_64-apple-darwin
22-
bundles: app,dmg
23+
bundles: dmg,app
2324
os: darwin
2425
arch: x86_64
2526
- host: macos-14
2627
target: aarch64-apple-darwin
27-
bundles: app,dmg
28+
bundles: dmg,app
2829
os: darwin
2930
arch: aarch64
3031
- host: windows-latest
@@ -101,7 +102,7 @@ jobs:
101102

102103
- name: Build
103104
run: |
104-
pnpm tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }},updater
105+
pnpm tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }}
105106
env:
106107
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
107108
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
@@ -141,7 +142,7 @@ jobs:
141142

142143
- name: Create Release
143144
# TODO: Change to stable version when available
144-
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
145+
uses: softprops/action-gh-release@v2
145146
with:
146147
draft: true
147148
files: '*/**'

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
'^[./]'
2424
],
2525
importOrderParserPlugins: ['typescript', 'jsx', 'decorators'],
26-
importOrderTypeScriptVersion: '4.4.0',
26+
importOrderTypeScriptVersion: '5.0.0',
2727
tailwindConfig: './packages/ui/tailwind.config.js',
2828
plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss']
2929
};

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"category": "Productivity",
4848
"shortDescription": "Spacedrive",
4949
"longDescription": "Cross-platform universal file explorer, powered by an open-source virtual distributed filesystem.",
50+
"createUpdaterArtifacts": "v1Compatible",
5051
"icon": [
5152
"icons/32x32.png",
5253
"icons/128x128.png",
@@ -66,7 +67,18 @@
6667
"minimumSystemVersion": "10.15",
6768
"exceptionDomain": null,
6869
"entitlements": null,
69-
"frameworks": ["../../.deps/Spacedrive.framework"]
70+
"frameworks": ["../../.deps/Spacedrive.framework"],
71+
"dmg": {
72+
"background": "dmg-background.png",
73+
"appPosition": {
74+
"x": 190,
75+
"y": 190
76+
},
77+
"applicationFolderPosition": {
78+
"x": 470,
79+
"y": 190
80+
}
81+
}
7082
},
7183
"windows": {
7284
"certificateThumbprint": null,
@@ -84,8 +96,6 @@
8496
},
8597
"plugins": {
8698
"updater": {
87-
"active": true,
88-
"dialog": false,
8999
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEZBMURCMkU5NEU3NDAyOEMKUldTTUFuUk82YklkK296dlkxUGkrTXhCT3ZMNFFVOWROcXNaS0RqWU1kMUdRV2tDdFdIS0Y3YUsK",
90100
"endpoints": [
91101
"https://spacedrive.com/api/releases/tauri/{{version}}/{{target}}/{{arch}}"

apps/mobile/src/navigation/DrawerNavigator.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import DrawerContent from '~/components/drawer/DrawerContent';
55
import { tw } from '~/lib/tailwind';
66

77
import type { RootStackParamList } from '.';
8-
import type { TabParamList } from './TabNavigator';
9-
import TabNavigator from './TabNavigator';
8+
import TabNavigator, { type TabParamList } from './TabNavigator';
109

1110
const Drawer = createDrawerNavigator<DrawerNavParamList>();
1211

interface/app/$libraryId/Explorer/DragOverlay.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { ClientRect, Modifier } from '@dnd-kit/core';
2-
import { DragOverlay as DragOverlayPrimitive } from '@dnd-kit/core';
1+
import { DragOverlay as DragOverlayPrimitive, type ClientRect, type Modifier } from '@dnd-kit/core';
32
import { getEventCoordinates } from '@dnd-kit/utilities';
43
import clsx from 'clsx';
54
import { memo, useEffect, useRef } from 'react';

interface/app/$libraryId/Explorer/useExplorer.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import { useCallback, useEffect, useMemo, useRef, useState, type RefObject } fro
22
import { useDebouncedCallback } from 'use-debounce';
33
import { proxy, snapshot, subscribe, useSnapshot } from 'valtio';
44
import { z } from 'zod';
5-
import type {
6-
ExplorerItem,
7-
ExplorerLayout,
8-
ExplorerSettings,
9-
FilePath,
10-
Location,
11-
NodeState,
12-
Tag
5+
import {
6+
ObjectKindEnum,
7+
type ExplorerItem,
8+
type ExplorerLayout,
9+
type ExplorerSettings,
10+
type FilePath,
11+
type Location,
12+
type NodeState,
13+
type Ordering,
14+
type OrderingKeys,
15+
type Tag
1316
} from '@sd/client';
14-
import { ObjectKindEnum, type Ordering, type OrderingKeys } from '@sd/client';
1517

1618
import { createDefaultExplorerSettings } from './store';
1719
import { uniqueId } from './util';

packages/client/src/utils/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import { QueryClient } from '@tanstack/react-query';
22
import { useMemo } from 'react';
33

44
import type { Object } from '..';
5-
import type { ExplorerItem, FilePath, NonIndexedPathItem } from '../core';
6-
import { LibraryConfigWrapped } from '../core';
5+
import {
6+
LibraryConfigWrapped,
7+
type ExplorerItem,
8+
type FilePath,
9+
type NonIndexedPathItem
10+
} from '../core';
711

812
export * from './jobs';
913

pnpm-lock.yaml

Lines changed: 12 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)