mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-10-01 17:29:29 +05:30
- electron-builder config moves to electron-builder.config.js so markitdown bundling is conditional per platform (PyInstaller only builds for the host OS; a missing binary now logs a warning and ships without it instead of failing the build); package.json static build section removed, all npm scripts pointed at the config; third-party-licenses/ added to packaged files - FIX (pre-existing): packaged apps looked for bundled pandoc in resources/bin, but extraFiles land next to the executable (Contents/ on macOS) — packaged builds silently fell back to system pandoc since 4.5. New bundledToolDir() resolves the real location for pandoc + markitdown - download-tools.js pins the win32 pandoc.exe SHA-256 (fetched + verified) - sharp packaging test accepts sharp 0.35's versioned binding filename - release.yml: bundle-markitdown step (best-effort) on every OS and a new macOS job; release aggregates linux+windows+macos artifacts Local release artifacts built and verified (dist/): - MarkdownConverter-4.7.0.AppImage (363MB, pandoc+markitdown bundled, packaged app boots clean, tools resolve at the fixed path) - markdown-converter_4.7.0_amd64.deb (293MB) - MarkdownConverter-Setup-4.7.0.exe (223MB), portable exe (223MB), zip (305MB) — pandoc bundled; markitdown omitted (cannot cross-build), legal docs verified inside app.asar 637/637 tests green; lint clean.
179 lines
4.6 KiB
YAML
179 lines
4.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Download external tools (pandoc)
|
|
run: node scripts/download-tools.js
|
|
|
|
- name: Bundle MarkItDown (optional, best effort)
|
|
# Freezes markitdown + Python into bin/linux/markitdown; failure is
|
|
# non-fatal — the build then ships without it and the app falls back
|
|
# to a system markitdown at runtime.
|
|
run: npm run bundle:markitdown
|
|
continue-on-error: true
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build Linux packages
|
|
run: npm run build:linux-ci -- --publish=never
|
|
|
|
- name: Upload Linux artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-artifacts
|
|
path: |
|
|
dist/*.deb
|
|
dist/*.AppImage
|
|
dist/*.snap
|
|
dist/*.rpm
|
|
retention-days: 5
|
|
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Download external tools (pandoc)
|
|
run: node scripts/download-tools.js
|
|
|
|
- name: Bundle MarkItDown (optional, best effort)
|
|
# Windows runners ship python + venv; non-fatal on failure — the
|
|
# package then omits the bundled binary by design
|
|
run: npm run bundle:markitdown
|
|
continue-on-error: true
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Decode certificate (if available)
|
|
if: ${{ env.CSC_LINK_BASE64 != '' }}
|
|
shell: pwsh
|
|
env:
|
|
CSC_LINK_BASE64: ${{ secrets.CSC_LINK_BASE64 }}
|
|
run: |
|
|
$bytes = [Convert]::FromBase64String("$env:CSC_LINK_BASE64")
|
|
[IO.File]::WriteAllBytes("${{ github.workspace }}\code-signing-cert.pfx", $bytes)
|
|
echo "CERT_AVAILABLE=true" >> $env:GITHUB_ENV
|
|
|
|
- name: Build Windows packages (signed)
|
|
if: ${{ env.CERT_AVAILABLE == 'true' }}
|
|
env:
|
|
CSC_LINK: code-signing-cert.pfx
|
|
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
|
run: npm run build:win-signed -- --publish=never
|
|
|
|
- name: Build Windows packages (unsigned)
|
|
if: ${{ env.CERT_AVAILABLE != 'true' }}
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
|
run: npm run build:win-unsigned -- --publish=never
|
|
|
|
- name: Upload Windows artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-artifacts
|
|
path: |
|
|
dist/*.exe
|
|
dist/*.zip
|
|
retention-days: 5
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Download external tools (pandoc)
|
|
run: node scripts/download-tools.js
|
|
|
|
- name: Bundle MarkItDown (optional, best effort)
|
|
run: npm run bundle:markitdown
|
|
continue-on-error: true
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build macOS packages
|
|
run: npm run build:mac -- --publish=never
|
|
|
|
- name: Upload macOS artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-artifacts
|
|
path: |
|
|
dist/*.dmg
|
|
dist/*.zip
|
|
retention-days: 5
|
|
|
|
release:
|
|
needs: [build-linux, build-windows, build-macos]
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download Linux artifacts
|
|
uses: actions/download-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: linux-artifacts
|
|
path: dist
|
|
|
|
- name: Download Windows artifacts
|
|
uses: actions/download-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: windows-artifacts
|
|
path: dist
|
|
|
|
- name: Download macOS artifacts
|
|
uses: actions/download-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: macos-artifacts
|
|
path: dist
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: dist/*
|