mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-20 22:50:11 -04:00
189 lines
4.3 KiB
YAML
189 lines
4.3 KiB
YAML
name: CI (Desktop)
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- new-ci
|
|
paths-ignore:
|
|
- '**/.md'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
typescript:
|
|
name: TypeScript
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 17
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.2.1
|
|
with:
|
|
version: 6.32.6
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
- name: Perform typechecks
|
|
run: pnpm -r exec tsc
|
|
|
|
build-js:
|
|
name: Build JS
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 17
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.2.1
|
|
with:
|
|
version: 6.32.6
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
- name: Build Desktop
|
|
run: pnpm desktop build
|
|
|
|
- name: Build Web
|
|
run: pnpm web build
|
|
|
|
build-rust:
|
|
name: Build Rust (${{ matrix.platform }})
|
|
runs-on: ${{ matrix.platform }}
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/install-deps
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 17
|
|
|
|
- name: Install Rust stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
components: rustfmt, rust-src
|
|
|
|
- name: Cache Rust Dependencies
|
|
uses: Brendonovich/rust-cache@v1
|
|
with:
|
|
sharedKey: all-${{ matrix.platform }}
|
|
|
|
- name: Generate Prisma client
|
|
working-directory: core
|
|
run: cargo run -p prisma-cli --release -- generate
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release
|
|
|
|
package-desktop:
|
|
name: Package desktop (${{ matrix.platform }})
|
|
runs-on: ${{ matrix.platform }}
|
|
needs: build-rust
|
|
strategy:
|
|
matrix:
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/install-deps
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 17
|
|
|
|
- name: Install Rust stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
components: rustfmt, rust-src
|
|
|
|
- name: Cache Rust Dependencies
|
|
uses: Brendonovich/rust-cache@v1
|
|
with:
|
|
sharedKey: all-${{ matrix.platform }}
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.2.1
|
|
with:
|
|
version: 6.32.6
|
|
|
|
- name: Install pnpm dependencies
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
- name: Generate Primsa client
|
|
working-directory: core
|
|
run: cargo prisma generate
|
|
|
|
- name: Build frontend
|
|
run: pnpm desktop build
|
|
|
|
- name: Build desktop
|
|
run: cargo build -p spacedrive --release
|
|
|
|
- name: Bundle
|
|
run: pnpm desktop tauri build
|
|
|
|
- name: Publish artifacts
|
|
uses: ./.github/actions/publish-desktop-artifacts
|
|
|
|
deploy-server:
|
|
name: Deploy server
|
|
runs-on: ubuntu-latest
|
|
needs: build-rust
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/install-deps
|
|
|
|
- name: Install Rust stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
profile: minimal
|
|
override: true
|
|
components: rustfmt, rust-src
|
|
|
|
- name: Cache Rust Dependencies
|
|
uses: Brendonovich/rust-cache@v1
|
|
with:
|
|
sharedKey: all-${{ matrix.platform }}
|
|
|
|
- name: Publish docker image
|
|
uses: ./.github/actions/publish-server
|
|
with:
|
|
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# TODO: Trigger deploy
|