-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 3.14 KB
/
Copy pathrelease.yml
File metadata and controls
98 lines (83 loc) · 3.14 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
name: "Release"
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
jobs:
publish:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest"
args: "" # 移除 universal 以簡化,GitHub 會根據 runner 架構自動打包
- platform: "ubuntu-22.04"
args: ""
- platform: "windows-latest"
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libavcodec-dev libavformat-dev libavutil-dev libswscale-dev librocksdb-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
- name: install dependencies (macos only)
if: matrix.platform == 'macos-latest'
run: brew install ffmpeg rocksdb
- name: install dependencies (windows only)
if: matrix.platform == 'windows-latest'
run: |
vcpkg install ffmpeg:x64-windows
echo "CMAKE_PREFIX_PATH=C:/vcpkg/installed/x64-windows" >> $GITHUB_ENV
- name: Build Core Engine
shell: bash
run: |
cd core_src
mkdir build && cd build
if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
else
cmake .. -DCMAKE_BUILD_TYPE=Release
fi
cmake --build . --config Release
# Prepare Sidecar directory
mkdir -p ../../gui/src-tauri/bin
# Get target triple for naming sidecar
if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then
cp Release/dupe_engine.exe ../../gui/src-tauri/bin/dupe_engine-x86_64-pc-windows-msvc.exe
elif [[ "${{ matrix.platform }}" == "macos-latest" ]]; then
ARCH=$(uname -m)
if [[ "$ARCH" == "arm64" ]]; then
cp dupe_engine ../../gui/src-tauri/bin/dupe_engine-aarch64-apple-darwin
else
cp dupe_engine ../../gui/src-tauri/bin/dupe_engine-x86_64-apple-darwin
fi
else
cp dupe_engine ../../gui/src-tauri/bin/dupe_engine-x86_64-unknown-linux-gnu
fi
- name: install frontend dependencies
run: cd gui && npm install
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__
releaseName: "Video Search Finder v__VERSION__"
releaseBody: "Automated release from GitHub Actions"
releaseDraft: true
prerelease: false
projectPath: "gui"
args: ${{ matrix.args }}