Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 11 additions & 96 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,13 @@
name: Release CLI
# Superseded by release.yml which builds both desktop app and CLI.
# This file is kept for reference only — it does not run.
#
# To build CLI-only releases (e.g., for CI/headless), use:
# workflow_dispatch on release.yml with cli-only flag (future enhancement)
name: "[deprecated] Release CLI Only"

on:
push:
tags: ['v*']

permissions:
contents: write

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
artifact: syncfu-darwin-arm64
os: macos-latest
- target: x86_64-apple-darwin
artifact: syncfu-darwin-x86_64
os: macos-latest
- target: x86_64-unknown-linux-gnu
artifact: syncfu-linux-x86_64
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
artifact: syncfu-linux-arm64
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
artifact: syncfu-windows-x86_64.exe
os: ubuntu-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
key: ${{ matrix.target }}

- name: Install cargo-zigbuild and cross-compile deps
if: runner.os == 'Linux'
run: |
pip3 install ziglang
cargo install cargo-zigbuild --version 0.19.8 --locked
sudo apt-get update
sudo apt-get install -y mingw-w64

- name: Install ARM64 cross-linker
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu cmake libclang-dev
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

- name: Build CLI (cross-compile via zigbuild)
if: runner.os == 'Linux'
run: cargo zigbuild --release -p syncfu-cli --target ${{ matrix.target }}

- name: Build CLI (native)
if: runner.os != 'Linux'
run: cargo build --release -p syncfu-cli --target ${{ matrix.target }}

- name: Rename binary
run: |
if [[ "${{ matrix.target }}" == *windows* ]]; then
cp target/${{ matrix.target }}/release/syncfu.exe ${{ matrix.artifact }}
else
cp target/${{ matrix.target }}/release/syncfu ${{ matrix.artifact }}
fi

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}

release:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
merge-multiple: true

- name: Generate checksums
run: sha256sum syncfu-* > checksums.txt

- name: Create release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
generate_release_notes: true
files: |
syncfu-*
checksums.txt
workflow_dispatch:
inputs:
note:
description: "Deprecated — use the main release.yml workflow instead"
required: false
202 changes: 202 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
name: Release

on:
push:
tags: ['v*']

permissions:
contents: write

jobs:
# --- Build CLI binaries for all platforms ---
build-cli:
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
artifact: syncfu-darwin-arm64
os: macos-latest
- target: x86_64-apple-darwin
artifact: syncfu-darwin-x86_64
os: macos-latest
- target: x86_64-unknown-linux-gnu
artifact: syncfu-linux-x86_64
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
artifact: syncfu-linux-arm64
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
artifact: syncfu-windows-x86_64.exe
os: ubuntu-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2
with:
key: cli-${{ matrix.target }}

- name: Install cargo-zigbuild and cross-compile deps
if: runner.os == 'Linux'
run: |
pip3 install ziglang
cargo install cargo-zigbuild --version 0.19.8 --locked
sudo apt-get update
sudo apt-get install -y mingw-w64

- name: Install ARM64 cross-linker
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu cmake libclang-dev
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

- name: Build CLI (cross-compile via zigbuild)
if: runner.os == 'Linux'
run: cargo zigbuild --release -p syncfu-cli --target ${{ matrix.target }}

- name: Build CLI (native)
if: runner.os != 'Linux'
run: cargo build --release -p syncfu-cli --target ${{ matrix.target }}

- name: Rename binary
run: |
if [[ "${{ matrix.target }}" == *windows* ]]; then
cp target/${{ matrix.target }}/release/syncfu.exe ${{ matrix.artifact }}
else
cp target/${{ matrix.target }}/release/syncfu ${{ matrix.artifact }}
fi

- uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.artifact }}
path: ${{ matrix.artifact }}

# --- Build desktop app for macOS, Windows, Linux ---
build-desktop:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
args: --target aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
args: --target x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
args: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
args: ""

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2
with:
key: desktop-${{ matrix.target }}

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: desktop/pnpm-lock.yaml

- name: Install frontend deps
working-directory: desktop
run: pnpm install --frozen-lockfile

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Build desktop app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: desktop
tauriScript: pnpm tauri
args: ${{ matrix.args }}
tagName: ${{ github.ref_name }}
releaseName: "syncfu ${{ github.ref_name }}"
releaseBody: ""
releaseDraft: true
prerelease: false
includeUpdaterJson: false

# --- Collect all artifacts into a single release ---
release:
needs: [build-cli, build-desktop]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v4
with:
pattern: cli-*
merge-multiple: true
path: cli-artifacts

- name: Generate checksums for CLI binaries
working-directory: cli-artifacts
run: sha256sum syncfu-* > checksums.txt

- name: Upload CLI artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${GITHUB_REF_NAME}"
# Wait for tauri-action to create the draft release
sleep 10
RELEASE_ID=$(gh api repos/${{ github.repository }}/releases --jq ".[] | select(.tag_name==\"${TAG}\") | .id" | head -1)
if [ -z "$RELEASE_ID" ]; then
echo "Release not found for tag ${TAG}, creating..."
gh release create "${TAG}" --repo "${{ github.repository }}" --draft --title "syncfu ${TAG}"
fi
gh release upload "${TAG}" cli-artifacts/* --repo "${{ github.repository }}" --clobber

- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${GITHUB_REF_NAME}"
gh release edit "${TAG}" --repo "${{ github.repository }}" --draft=false \
--notes "## Install

**macOS / Linux (one command):**
\`\`\`sh
curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | sh
\`\`\`

**Windows (PowerShell):**
\`\`\`powershell
irm https://raw.githubusercontent.com/${{ github.repository }}/main/install.ps1 | iex
\`\`\`

## What's included
- **Desktop app** — tray icon, overlay notifications, HTTP server on port 9868
- **CLI** — \`syncfu send \"hello\"\` from any terminal or AI agent

## Changes
See commit history for details."
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading