121 lines
3.3 KiB
YAML
121 lines
3.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
inputs:
|
|
release:
|
|
description: "Create GitHub release"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
env:
|
|
NODE_VERSION: "22"
|
|
RUST_TOOLCHAIN: "stable"
|
|
|
|
jobs:
|
|
build-tauri:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
artifact_suffix: linux-x64
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install system dependencies (Linux)
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
libappindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
libasound2-dev \
|
|
libsndfile1
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: npm
|
|
cache-dependency-path: client/package-lock.json
|
|
|
|
- name: Set up Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Cache Cargo
|
|
uses: actions/cache@v4
|
|
timeout-minutes: 2
|
|
continue-on-error: true
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
client/src-tauri/target/
|
|
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('client/src-tauri/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-${{ matrix.target }}-
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Install frontend dependencies
|
|
run: cd client && npm ci
|
|
|
|
- name: Build Tauri application
|
|
run: cd client && npm run tauri build -- --target ${{ matrix.target }}
|
|
env:
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
|
|
- name: Upload Linux artifacts
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: noteflow-${{ matrix.artifact_suffix }}
|
|
path: |
|
|
client/src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
|
|
client/src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
|
|
client/src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
|
|
if-no-files-found: warn
|
|
|
|
release:
|
|
needs: build-tauri
|
|
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.release == 'true'
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/**/*.deb
|
|
artifacts/**/*.AppImage
|
|
artifacts/**/*.rpm
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|