Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Binaries

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
build-and-release:
name: Build binary on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: markitdown-linux-x64
executable_name: markitdown
- os: macos-latest
artifact_name: markitdown-macos-x64
executable_name: markitdown
- os: windows-latest
artifact_name: markitdown-windows-x64.exe
executable_name: markitdown.exe

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[all] pyinstaller

- name: Build with PyInstaller
# Note: --collect-all magika is required for file type inference
run: |
pyinstaller --onefile --name markitdown --collect-all magika scripts/cli.py

- name: Rename binary for platform
shell: bash
run: |
mv dist/${{ matrix.executable_name }} dist/${{ matrix.artifact_name }}

- name: Upload Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/${{ matrix.artifact_name }}
27 changes: 27 additions & 0 deletions homebrew/markitdown.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Markitdown < Formula
desc "Python tool for converting files and office documents to Markdown"
homepage "https://github.com/microsoft/markitdown"
version "0.1.4" # Update this on new releases
license "MIT"

if OS.mac? && Hardware::CPU.intel?
url "https://github.com/microsoft/markitdown/releases/download/v#{version}/markitdown-macos-x64"
sha256 "REPLACE_WITH_REAL_SHA256_WHEN_RELEASED"
elsif OS.mac? && Hardware::CPU.arm?
# For now, using x64 binary on ARM via Rosetta until we add ARM runners to CI
url "https://github.com/microsoft/markitdown/releases/download/v#{version}/markitdown-macos-x64"
sha256 "REPLACE_WITH_REAL_SHA256_WHEN_RELEASED"
elsif OS.linux? && Hardware::CPU.intel?
url "https://github.com/microsoft/markitdown/releases/download/v#{version}/markitdown-linux-x64"
sha256 "REPLACE_WITH_REAL_SHA256_WHEN_RELEASED"
end

def install
bin.install "markitdown-macos-x64" => "markitdown" if OS.mac?
bin.install "markitdown-linux-x64" => "markitdown" if OS.linux?
end

test do
system "#{bin}/markitdown", "--version"
end
end
4 changes: 4 additions & 0 deletions scripts/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from markitdown.__main__ import main

if __name__ == "__main__":
main()