GitHub Actions for Leanpub.com
Project description
Leanpub Multi Action
A GitHub Action to interact with the Leanpub API. Preview, publish, and check job status for your Leanpub books — directly from your GitHub workflows.
Quick Start
- name: "Preview Book"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
Inputs
| Name | Required | Default | Description |
|---|---|---|---|
leanpub-api-key |
Yes | — | Leanpub API key (requires a Pro plan). Store as a GitHub Secret. |
leanpub-book-slug |
Yes | — | Book slug — the path component after https://leanpub.com/. |
action |
Yes | — | Action to perform: preview, publish, or check-status. |
email-readers |
No | "false" |
Email readers about a new publish. Only used with publish. |
release-notes |
No | — | Release notes for the publish. Only used with publish. |
subset |
No | "false" |
Preview only the files listed in Subset.txt. Only used with preview. |
single-file |
No | — | Path to a Markdown file for single-file preview. Only used with preview. |
Examples
Full preview on push
---
name: "Preview on Push"
"on":
push:
branches: ["preview"]
jobs:
preview:
runs-on: "ubuntu-latest"
steps:
- name: "Preview Book"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
Subset preview
Preview only the files listed in your book's Subset.txt:
- name: "Subset Preview"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
subset: "true"
Single-file preview
Preview a single Markdown file without modifying Subset.txt.
The output PDF is saved as {slug}-single-file.pdf in your Dropbox previews folder.
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Single File Preview"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "preview"
single-file: "manuscript/chapter-05.md"
Publish with release notes
- name: "Publish"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "publish"
email-readers: "true"
release-notes: "Chapter 5 added"
Check job status
- name: "Check Status"
uses: "lykinsbd/leanpub-multi-action@v2"
with:
leanpub-api-key: "${{ secrets.LEANPUB_API_KEY }}"
leanpub-book-slug: "mygreatbook"
action: "check-status"
CLI Usage
The action also ships as a standalone CLI tool called lma.
uv tool install leanpub-multi-action
or with pip:
pip install leanpub-multi-action
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook preview
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook preview --subset
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook preview --single-file chapter.md
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook publish --email-readers --release-notes "v2"
lma --leanpub-api-key YOUR_KEY --book-slug mygreatbook check-status
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leanpub_multi_action-2.0.1.tar.gz.
File metadata
- Download URL: leanpub_multi_action-2.0.1.tar.gz
- Upload date:
- Size: 47.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
571daddd3f381efeeb0e494edd94ec80e3fb96007805d60c2c4436bd2600cf5a
|
|
| MD5 |
ede26cf32493318c498ddb8179039839
|
|
| BLAKE2b-256 |
fb6c1e9ce3a51a68d98193f55f2dab29ba6dd7e7abb135e4cd45b9163c9024fe
|
File details
Details for the file leanpub_multi_action-2.0.1-py3-none-any.whl.
File metadata
- Download URL: leanpub_multi_action-2.0.1-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e79024da45a123943d422611a4e4ecb2e2c1e05ac4831694e7d70e7f33c27937
|
|
| MD5 |
e90dbf3b939f8698d601faa9780d4856
|
|
| BLAKE2b-256 |
e72cada0daba9e5b0e5b779e0578e9c0f66abb2463c2c048b6524643156deeb1
|