docs: highlight optional API key as a feature in README #20
Workflow file for this run
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: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build for ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| target: [x86_64, aarch64] | |
| exclude: | |
| - os: ubuntu-latest | |
| target: aarch64 | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64 | |
| rust_target: x86_64-unknown-linux-gnu | |
| artifact_name: pdf-to-markdown-linux-x86_64 | |
| - os: macos-latest | |
| target: x86_64 | |
| rust_target: x86_64-apple-darwin | |
| artifact_name: pdf-to-markdown-macos-x86_64 | |
| - os: macos-latest | |
| target: aarch64 | |
| rust_target: aarch64-apple-darwin | |
| artifact_name: pdf-to-markdown-macos-aarch64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust_target }} | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Linux system dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev libsecret-1-dev | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| run: cargo test --release | |
| - name: Build release | |
| run: cargo build --release --target ${{ matrix.rust_target }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: target/${{ matrix.rust_target }}/release/pdf-to-markdown${{ matrix.os == 'windows-latest' && '.exe' || '' }} | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Display structure of downloaded files | |
| run: | | |
| ls -la | |
| echo "--- Linux artifact ---" | |
| ls -la pdf-to-markdown-linux-x86_64/ || echo "Directory not found" | |
| echo "--- macOS artifact ---" | |
| ls -la pdf-to-markdown-macos-x86_64/ || echo "Directory not found" | |
| - name: Rename artifacts with platform suffix | |
| run: | | |
| if [ -d "pdf-to-markdown-linux-x86_64" ]; then | |
| mv pdf-to-markdown-linux-x86_64/pdf-to-markdown pdf-to-markdown-linux-x86_64/pdf-to-markdown-linux-x86_64 | |
| chmod +x pdf-to-markdown-linux-x86_64/pdf-to-markdown-linux-x86_64 | |
| ls -la pdf-to-markdown-linux-x86_64/ | |
| fi | |
| if [ -d "pdf-to-markdown-macos-x86_64" ]; then | |
| mv pdf-to-markdown-macos-x86_64/pdf-to-markdown pdf-to-markdown-macos-x86_64/pdf-to-markdown-macos-x86_64 | |
| chmod +x pdf-to-markdown-macos-x86_64/pdf-to-markdown-macos-x86_64 | |
| ls -la pdf-to-markdown-macos-x86_64/ | |
| fi | |
| if [ -d "pdf-to-markdown-macos-aarch64" ]; then | |
| mv pdf-to-markdown-macos-aarch64/pdf-to-markdown pdf-to-markdown-macos-aarch64/pdf-to-markdown-macos-aarch64 | |
| chmod +x pdf-to-markdown-macos-aarch64/pdf-to-markdown-macos-aarch64 | |
| ls -la pdf-to-markdown-macos-aarch64/ | |
| fi | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| pdf-to-markdown-linux-x86_64/pdf-to-markdown-linux-x86_64 | |
| pdf-to-markdown-macos-x86_64/pdf-to-markdown-macos-x86_64 | |
| pdf-to-markdown-macos-aarch64/pdf-to-markdown-macos-aarch64 | |
| generate_release_notes: true |