-
Notifications
You must be signed in to change notification settings - Fork 57
114 lines (99 loc) · 2.97 KB
/
Copy pathrelease.yml
File metadata and controls
114 lines (99 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release desktop builds
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
env:
# Next.js must emit a static export so Tauri can bundle ../out
NEXT_EXPORT: "1"
jobs:
build:
name: ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- platform: macOS (Apple Silicon)
os: macos-14
target: aarch64-apple-darwin
bin-ext: ""
- platform: Linux (x86_64)
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
bin-ext: ""
- platform: Windows (x86_64)
os: windows-latest
target: x86_64-pc-windows-msvc
bin-ext: ".exe"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
build-essential \
curl wget file \
libssl-dev \
libgtk-3-dev \
libxdo-dev \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libgdk-pixbuf-2.0-0 \
libcairo2 \
libffi-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo registry and build
uses: swatinem/rust-cache@v2
with:
workspaces: frontend/src-tauri -> target
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install Python
run: uv python install
- name: Build backend sidecar
run: |
uv sync --frozen
uv run pyinstaller markdown-reader-backend.spec
- name: Stage sidecar with target triple
shell: bash
run: |
mkdir -p frontend/src-tauri/binaries
src="dist/markdown-reader-backend${{ matrix.bin-ext }}"
dest="frontend/src-tauri/binaries/markdown-reader-backend-${{ matrix.target }}${{ matrix.bin-ext }}"
cp "$src" "$dest"
chmod +x "$dest" || true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Build and release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: frontend
tagName: ${{ github.ref_name }}
releaseName: "Markdown Reader ${{ github.ref_name }}"
releaseDraft: true
prerelease: false
args: --target ${{ matrix.target }}