release-linux-x86.yml #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release-linux-x86.yml | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-linux-x86: | |
| name: Build Linux 32-bit (Debian + AppImage) | |
| 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: Install system dependencies (32-bit) | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev:i386 \ | |
| libappindicator3-dev:i386 \ | |
| librsvg2-dev:i386 \ | |
| patchelf \ | |
| libssl-dev:i386 \ | |
| gcc-multilib \ | |
| g++-multilib | |
| - 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 (Linux x86) | |
| run: npx tauri build --target i686-unknown-linux-gnu 2>&1 | |
| 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 | |
| path: | | |
| src-tauri/target/i686-unknown-linux-gnu/release/bundle/deb/*.deb | |
| src-tauri/target/i686-unknown-linux-gnu/release/bundle/appimage/*.AppImage | |
| 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 | |
| src-tauri/target/i686-unknown-linux-gnu/release/bundle/appimage/*.AppImage | |
| 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: | | |
| pacman -Syu --noconfirm | |
| pacman -S --noconfirm base-devel binutils fakeroot sudo | |
| mkdir -p /tmp/multimdreader-pkg/src | |
| APPIMAGE=$(find /artifacts/ -name "*.AppImage" | head -1) | |
| if [ -n "$APPIMAGE" ]; then | |
| cp "$APPIMAGE" /tmp/multimdreader-pkg/src/MultiMDReader.AppImage | |
| chmod +x /tmp/multimdreader-pkg/src/MultiMDReader.AppImage | |
| else | |
| echo "ERROR: No AppImage found" | |
| exit 1 | |
| fi | |
| 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=$VERSION | |
| pkgrel=1 | |
| pkgdesc="A cross-platform Markdown file reader — AppImage binary (i386)" | |
| arch=('i686') | |
| url="https://github.com/PiBOH/multimdreader" | |
| license=('MIT') | |
| depends=('webkit2gtk-4.1' 'gtk3') | |
| provides=('multimdreader') | |
| conflicts=('multimdreader') | |
| source=("MultiMDReader.AppImage") | |
| sha256sums=('SKIP') | |
| package() { | |
| install -Dm755 "\$srcdir/MultiMDReader.AppImage" "\$pkgdir/usr/bin/multimdreader" | |
| install -Dm644 /dev/stdin "\$pkgdir/usr/share/applications/multimdreader.desktop" << DESKTOP | |
| [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; | |
| DESKTOP | |
| } | |
| PKGBUILDEOF | |
| 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" | |
| 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 }} |