Skip to content

ci: pin pnpm version during ci #2277

ci: pin pnpm version during ci

ci: pin pnpm version during ci #2277

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
target: linux_x86_64
- os: macos-latest
rust_target: x86_64-apple-darwin
target: macos_x86_64
- os: macos-latest
rust_target: aarch64-apple-darwin
target: macos_aarch64
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
target: windows_x86_64
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- name: Set short sha
shell: bash
run: echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
target: ${{ matrix.platform.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri/
- name: install webkit2gtk (ubuntu only)
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: install app dependencies
run: pnpm install
- name: Prettier
run: pnpm prettier
- name: Lint
run: pnpm lint
- name: Build interface
run: pnpm build
- name: fmt
run: cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
- name: Clippy
run: cargo clippy --manifest-path=src-tauri/Cargo.toml --all-targets --all-features -- -D warnings
- uses: JonasKruckenberg/tauri-build@next
id: build
with:
target: ${{ matrix.platform.rust_target }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRONGHOLD_SALT: ${{ secrets.STRONGHOLD_SALT }}
- uses: actions/upload-artifact@v4
with:
name: Sparus-${{ env.SHORT_SHA }}-${{ matrix.platform.target }}.zip
path: "${{ join(fromJSON(steps.build.outputs.artifacts), '\n') }}"
if-no-files-found: error