mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2025-12-11 20:15:30 +01:00
Update CI and release workflows, add TypeScript support, and refactor code for clarity
- Standardized quotes in CI and release workflow files for consistency. - Introduced TypeScript job in CI workflow to check for file changes and run type checks. - Refactored function signatures in the macOS Tauri library for improved readability. - Updated Tauri configuration for release build commands and include external daemon binary. - Enhanced artifact handling in release workflow for better organization and clarity.
This commit is contained in:
parent
651e9bae46
commit
ccb5909ebd
69
.github/workflows/ci.yml
vendored
69
.github/workflows/ci.yml
vendored
@ -35,10 +35,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
swap-size-mb: 3072
|
swap-size-mb: 3072
|
||||||
root-reserve-mb: 6144
|
root-reserve-mb: 6144
|
||||||
remove-dotnet: 'true'
|
remove-dotnet: "true"
|
||||||
remove-codeql: 'true'
|
remove-codeql: "true"
|
||||||
remove-haskell: 'true'
|
remove-haskell: "true"
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: "true"
|
||||||
|
|
||||||
- name: Symlink target to C:\
|
- name: Symlink target to C:\
|
||||||
if: ${{ runner.os == 'Windows' }}
|
if: ${{ runner.os == 'Windows' }}
|
||||||
@ -82,7 +82,7 @@ jobs:
|
|||||||
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
||||||
uses: ./.github/actions/setup-rust
|
uses: ./.github/actions/setup-rust
|
||||||
with:
|
with:
|
||||||
restore-cache: 'false'
|
restore-cache: "false"
|
||||||
|
|
||||||
- name: Run rustfmt
|
- name: Run rustfmt
|
||||||
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
||||||
@ -90,7 +90,7 @@ jobs:
|
|||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false # Don't cancel other platforms if one fails
|
fail-fast: false # Don't cancel other platforms if one fails
|
||||||
matrix:
|
matrix:
|
||||||
settings:
|
settings:
|
||||||
- host: macos-13
|
- host: macos-13
|
||||||
@ -113,10 +113,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
swap-size-mb: 3072
|
swap-size-mb: 3072
|
||||||
root-reserve-mb: 6144
|
root-reserve-mb: 6144
|
||||||
remove-dotnet: 'true'
|
remove-dotnet: "true"
|
||||||
remove-codeql: 'true'
|
remove-codeql: "true"
|
||||||
remove-haskell: 'true'
|
remove-haskell: "true"
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: "true"
|
||||||
|
|
||||||
- name: Symlink target to C:\
|
- name: Symlink target to C:\
|
||||||
if: ${{ runner.os == 'Windows' }}
|
if: ${{ runner.os == 'Windows' }}
|
||||||
@ -195,10 +195,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
swap-size-mb: 3072
|
swap-size-mb: 3072
|
||||||
root-reserve-mb: 6144
|
root-reserve-mb: 6144
|
||||||
remove-dotnet: 'true'
|
remove-dotnet: "true"
|
||||||
remove-codeql: 'true'
|
remove-codeql: "true"
|
||||||
remove-haskell: 'true'
|
remove-haskell: "true"
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: "true"
|
||||||
|
|
||||||
- name: Symlink target to C:\
|
- name: Symlink target to C:\
|
||||||
if: ${{ runner.os == 'Windows' }}
|
if: ${{ runner.os == 'Windows' }}
|
||||||
@ -209,7 +209,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# TODO: Re-enable when submodule repos are public
|
# OPTIONAL: Re-enable when submodule repos are public
|
||||||
# with:
|
# with:
|
||||||
# submodules: recursive
|
# submodules: recursive
|
||||||
|
|
||||||
@ -247,3 +247,42 @@ jobs:
|
|||||||
name: cli-${{ matrix.settings.platform }}
|
name: cli-${{ matrix.settings.platform }}
|
||||||
path: dist/*
|
path: dist/*
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
typescript:
|
||||||
|
name: TypeScript
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
timeout-minutes: 15
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check if files have changed
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
continue-on-error: true
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
changes:
|
||||||
|
- 'apps/tauri/**'
|
||||||
|
- 'packages/**'
|
||||||
|
- 'package.json'
|
||||||
|
- 'bun.lockb'
|
||||||
|
- 'tsconfig.json'
|
||||||
|
- '.github/workflows/ci.yml'
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
||||||
|
uses: oven-sh/setup-bun@v1
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: TypeScript typecheck
|
||||||
|
if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true'
|
||||||
|
run: bun run typecheck
|
||||||
|
working-directory: apps/tauri
|
||||||
|
|||||||
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
@ -3,8 +3,8 @@ name: Release
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/release.yml'
|
- ".github/workflows/release.yml"
|
||||||
- '.github/actions/publish-artifacts/**'
|
- ".github/actions/publish-artifacts/**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21
|
# From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21
|
||||||
@ -138,10 +138,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
swap-size-mb: 3072
|
swap-size-mb: 3072
|
||||||
root-reserve-mb: 6144
|
root-reserve-mb: 6144
|
||||||
remove-dotnet: 'true'
|
remove-dotnet: "true"
|
||||||
remove-codeql: 'true'
|
remove-codeql: "true"
|
||||||
remove-haskell: 'true'
|
remove-haskell: "true"
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: "true"
|
||||||
|
|
||||||
- name: Symlink target to C:\
|
- name: Symlink target to C:\
|
||||||
if: ${{ runner.os == 'Windows' }}
|
if: ${{ runner.os == 'Windows' }}
|
||||||
@ -182,6 +182,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build daemon binary
|
||||||
|
run: cargo build --release --bin sd-daemon --target ${{ matrix.settings.target }}
|
||||||
|
|
||||||
|
- name: Prepare daemon binary for bundling (Unix)
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
mkdir -p target/release
|
||||||
|
cp target/${{ matrix.settings.target }}/release/sd-daemon target/release/sd-daemon-${{ matrix.settings.target }}
|
||||||
|
|
||||||
|
- name: Prepare daemon binary for bundling (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
New-Item -ItemType Directory -Force -Path target/release
|
||||||
|
Copy-Item target/${{ matrix.settings.target }}/release/sd-daemon.exe target/release/sd-daemon-${{ matrix.settings.target }}.exe
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
bun tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }}
|
bun tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }}
|
||||||
@ -201,7 +217,7 @@ jobs:
|
|||||||
if: ${{ runner.os == 'Linux' }}
|
if: ${{ runner.os == 'Linux' }}
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
XZ_OPT='-T0 -7' tar -cJf apps/desktop/dist.tar.xz -C apps/desktop/dist .
|
XZ_OPT='-T0 -7' tar -cJf apps/tauri/dist.tar.xz -C apps/tauri/dist .
|
||||||
|
|
||||||
- name: Publish Artifacts
|
- name: Publish Artifacts
|
||||||
uses: ./.github/actions/publish-artifacts
|
uses: ./.github/actions/publish-artifacts
|
||||||
@ -211,12 +227,12 @@ jobs:
|
|||||||
target: ${{ matrix.settings.target }}
|
target: ${{ matrix.settings.target }}
|
||||||
profile: release
|
profile: release
|
||||||
|
|
||||||
# V2 CLI Release
|
# Create unified release with CLI and Desktop artifacts
|
||||||
release:
|
release:
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Create Release
|
name: Create Release
|
||||||
needs: cli-build
|
needs: [cli-build, desktop-main]
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
@ -227,21 +243,4 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: '*/**'
|
files: "*/**"
|
||||||
|
|
||||||
# V2 Desktop release
|
|
||||||
release-desktop:
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Create Desktop Release
|
|
||||||
needs: desktop-main
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
files: '*/**'
|
|
||||||
|
|||||||
@ -59,7 +59,10 @@ where
|
|||||||
/// This function is called from Swift when a drag session ends.
|
/// This function is called from Swift when a drag session ends.
|
||||||
/// The `session_id` must be a valid null-terminated C string pointer.
|
/// The `session_id` must be a valid null-terminated C string pointer.
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn rust_drag_ended_callback(session_id: *const std::ffi::c_char, was_dropped: Bool) {
|
pub unsafe extern "C" fn rust_drag_ended_callback(
|
||||||
|
session_id: *const std::ffi::c_char,
|
||||||
|
was_dropped: Bool,
|
||||||
|
) {
|
||||||
let session_id_str = unsafe {
|
let session_id_str = unsafe {
|
||||||
std::ffi::CStr::from_ptr(session_id)
|
std::ffi::CStr::from_ptr(session_id)
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"identifier": "com.spacedrive.desktop",
|
"identifier": "com.spacedrive.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "bun run dev:with-daemon",
|
"beforeDevCommand": "bun run dev:with-daemon",
|
||||||
"beforeBuildCommand": "cargo build --release --bin sd-daemon --manifest-path ../../Cargo.toml && bun run build",
|
"beforeBuildCommand": "bun run build",
|
||||||
"devUrl": "http://localhost:1420",
|
"devUrl": "http://localhost:1420",
|
||||||
"frontendDist": "../dist"
|
"frontendDist": "../dist"
|
||||||
},
|
},
|
||||||
@ -62,6 +62,9 @@
|
|||||||
"icons/icon.icns",
|
"icons/icon.icns",
|
||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
|
"externalBin": [
|
||||||
|
"../../../target/release/sd-daemon"
|
||||||
|
],
|
||||||
"resources": {
|
"resources": {
|
||||||
"gen/**/*": "./"
|
"gen/**/*": "./"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user