-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (172 loc) · 6.95 KB
/
Copy pathrelease-linux-x86.yml
File metadata and controls
192 lines (172 loc) · 6.95 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: release-linux-x86.yml
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-linux-x86:
name: Build Linux 32-bit (Debian)
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: i686-unknown-linux-gnu
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Enable i386 architecture & install multilib toolchain
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --allow-downgrades \
build-essential \
patchelf \
gcc-multilib \
g++-multilib
- name: Install 32-bit (i386) Tauri dependencies
# libappindicator3-dev / libayatana-appindicator3-dev NON esistono per i386
# (ayatana e' 64-bit only) e NON servono: MultiMDReader non ha system tray.
run: |
sudo apt-get install -y --allow-downgrades \
libwebkit2gtk-4.1-dev:i386 \
libgtk-3-dev:i386 \
librsvg2-dev:i386 \
libssl-dev:i386
- name: Install frontend dependencies
run: npm install
- name: Build frontend
run: npm run build
- name: Generate Tauri icons
run: npx tauri icon public/icon.png
continue-on-error: true
- name: Install Tauri Rust dependencies
working-directory: src-tauri
run: cargo fetch
- name: Build Tauri app — Debian package (32-bit)
# Solo .deb: l'AppImage i686 non e' supportata (linuxdeploy non ha build i686)
env:
PKG_CONFIG_ALLOW_CROSS: "1"
PKG_CONFIG_LIBDIR: "/usr/lib/i386-linux-gnu/pkgconfig:/usr/local/share/pkgconfig:/usr/share/pkgconfig"
PKG_CONFIG_SYSROOT_DIR: "/"
run: npx tauri build --target i686-unknown-linux-gnu --bundles deb
timeout-minutes: 30
- name: List build output
run: find src-tauri/target/i686-unknown-linux-gnu/release/bundle -type f 2>/dev/null || true
continue-on-error: true
- name: Upload Linux x86 artifacts
uses: actions/upload-artifact@v4
with:
name: multimdreader-linux-x86-artifacts
if-no-files-found: error
path: |
src-tauri/target/i686-unknown-linux-gnu/release/bundle/deb/*.deb
retention-days: 30
- name: Create/Update GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: 'MultiMDReader ${{ github.ref_name }}'
body: 'See release assets below.'
draft: false
prerelease: false
files: |
src-tauri/target/i686-unknown-linux-gnu/release/bundle/deb/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-arch-x86:
name: Build Arch Linux Package (x86)
runs-on: ubuntu-latest
needs: build-linux-x86
steps:
- name: Download Linux x86 artifacts
uses: actions/download-artifact@v4
with:
name: multimdreader-linux-x86-artifacts
path: artifacts/
- name: Build Arch package (x86)
uses: addnab/docker-run-action@v3
with:
image: archlinux:latest
options: -v ${{ github.workspace }}/artifacts:/artifacts
run: |
set -e
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel binutils fakeroot sudo dpkg
mkdir -p /tmp/multimdreader-pkg/src
# Estrai il binario a 32-bit dal .deb (non esiste AppImage i686)
DEB=$(find /artifacts/ -name "*.deb" | head -1)
if [ -z "$DEB" ]; then echo "ERROR: No .deb found"; exit 1; fi
dpkg-deb -x "$DEB" /tmp/extract
BIN=$(find /tmp/extract -type f -path "*/bin/*" | head -1)
if [ -z "$BIN" ]; then BIN=$(find /tmp/extract -type f -perm -111 ! -name "*.so*" | head -1); fi
if [ -z "$BIN" ]; then echo "ERROR: No executable found inside .deb"; exit 1; fi
cp "$BIN" /tmp/multimdreader-pkg/src/MultiMDReader
chmod +x /tmp/multimdreader-pkg/src/MultiMDReader
# File .desktop (attenzione: tutto indentato a 12 spazi, anche il terminatore)
cat > /tmp/multimdreader-pkg/src/multimdreader.desktop << 'DESKTOPEOF'
[Desktop Entry]
Name=MultiMDReader
Comment=Cross-Platform Markdown Reader
Exec=multimdreader %F
Icon=multimdreader
Terminal=false
Type=Application
Categories=Office;TextEditor;Viewer;
MimeType=text/markdown;text/x-markdown;
DESKTOPEOF
TAG="${{ github.ref_name }}"
VERSION="${TAG#v}"
[ -z "$VERSION" ] || [ "$VERSION" = "$TAG" ] && VERSION="0.0.6"
cat > /tmp/multimdreader-pkg/PKGBUILD << 'PKGBUILDEOF'
pkgname=multimdreader-bin
pkgver=PLACEHOLDER
pkgrel=1
pkgdesc="A cross-platform Markdown file reader — 32-bit binary (i386)"
arch=('i686')
url="https://github.com/PiBOH/multimdreader"
license=('MIT')
depends=('webkit2gtk-4.1' 'gtk3')
provides=('multimdreader')
conflicts=('multimdreader')
source=("MultiMDReader" "multimdreader.desktop")
sha256sums=('SKIP' 'SKIP')
package() {
install -Dm755 "$srcdir/MultiMDReader" "$pkgdir/usr/bin/multimdreader"
install -Dm644 "$srcdir/multimdreader.desktop" "$pkgdir/usr/share/applications/multimdreader.desktop"
}
PKGBUILDEOF
sed -i "s/pkgver=PLACEHOLDER/pkgver=$VERSION/" /tmp/multimdreader-pkg/PKGBUILD
cd /tmp/multimdreader-pkg
useradd -m builduser
echo "builduser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
chown -R builduser:builduser /tmp/multimdreader-pkg
su - builduser -c "cd /tmp/multimdreader-pkg && makepkg -sf --noconfirm --ignorearch"
find /tmp/multimdreader-pkg -name "*.pkg.tar.zst" -exec cp {} /artifacts/ \;
- name: Upload Arch x86 package
uses: actions/upload-artifact@v4
with:
name: multimdreader-arch-x86-package
path: artifacts/*.pkg.tar.zst
retention-days: 30
- name: Create/Update GitHub Release with Arch x86 package
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: 'MultiMDReader ${{ github.ref_name }}'
body: 'See release assets below.'
draft: false
prerelease: false
files: artifacts/*.pkg.tar.zst
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}