-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (117 loc) · 4.77 KB
/
Copy pathtauri-build.yml
File metadata and controls
141 lines (117 loc) · 4.77 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Tauri Desktop Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
target: aarch64-apple-darwin
- platform: macos-latest
target: x86_64-apple-darwin
- platform: ubuntu-latest
target: x86_64-unknown-linux-gnu
bundles: deb,rpm,appimage
- platform: ubuntu-latest
target: aarch64-unknown-linux-gnu
bundles: deb,rpm
- platform: windows-latest
target: x86_64-pc-windows-msvc
bundles: msi,nsis
- platform: windows-latest
target: aarch64-pc-windows-msvc
bundles: msi,nsis
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux native build dependencies
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Install Linux ARM64 cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
CODENAME="$(lsb_release -cs)"
sudo dpkg --add-architecture arm64
if [ -f /etc/apt/sources.list ]; then
sudo sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list
fi
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
sudo sed -i '/^Architectures:/d; /^Types: deb$/a Architectures: amd64' \
/etc/apt/sources.list.d/ubuntu.sources
fi
{
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME} main restricted universe multiverse"
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME}-updates main restricted universe multiverse"
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME}-backports main restricted universe multiverse"
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME}-security main restricted universe multiverse"
} | sudo tee /etc/apt/sources.list.d/arm64.list
sudo apt-get update
GLIB_VERSION="$(apt-cache madison libglib2.0-dev:arm64 | awk 'NR==1 {print $3}')"
if [ -z "${GLIB_VERSION}" ]; then
echo "Unable to resolve libglib2.0-dev:arm64 version"
exit 1
fi
sudo apt-get install -y --allow-downgrades \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
pkg-config \
libssl-dev:arm64 \
libglib2.0-dev:arm64=${GLIB_VERSION} \
libglib2.0-dev-bin=${GLIB_VERSION} \
libwebkit2gtk-4.1-dev:arm64 \
libgtk-3-dev:arm64 \
libayatana-appindicator3-dev:arm64 \
librsvg2-dev:arm64 \
patchelf
mkdir -p ~/.cargo
cat >> ~/.cargo/config.toml <<EOF
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
EOF
echo 'CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc' >> $GITHUB_ENV
echo 'CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++' >> $GITHUB_ENV
echo 'PKG_CONFIG_ALLOW_CROSS=1' >> $GITHUB_ENV
echo 'PKG_CONFIG_SYSROOT_DIR=/' >> $GITHUB_ENV
echo 'PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig' >> $GITHUB_ENV
echo 'OPENSSL_DIR=/usr' >> $GITHUB_ENV
echo 'OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu' >> $GITHUB_ENV
echo 'OPENSSL_INCLUDE_DIR=/usr/include' >> $GITHUB_ENV
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install dependencies
run: npm ci
- name: Build Tauri App
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: FOFA Leak Search ${{ github.ref_name }}
releaseBody: |
FOFA Leak Search Desktop Release
releaseDraft: true
prerelease: false
tauriScript: npx tauri
args: >
--target ${{ matrix.target }}
${{ matrix.bundles && format('--bundles {0}', matrix.bundles) || '' }}