mirror of
https://github.com/0xAX/linux-insides.git
synced 2025-05-14 18:28:44 +00:00
Merge b20c386332
into 3504d5315f
This commit is contained in:
commit
d32efcd7b9
82
.github/workflows/generate_release.yaml
vendored
Normal file
82
.github/workflows/generate_release.yaml
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
# Note: Indentation here is of 2 spaces.
|
||||
|
||||
name: Generate release with ebooks
|
||||
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
workflow_dispatch: {} # For manual switch.
|
||||
# End of on.
|
||||
|
||||
|
||||
jobs:
|
||||
release_ebooks:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "latest"
|
||||
|
||||
# HonKit is a maintained fork of GitBook.
|
||||
- name: Install honkit
|
||||
run: npm install honkit -g
|
||||
|
||||
# APT install can take a long time due to installing dependencies,
|
||||
# so we will use caching.
|
||||
- name: Install calibre for ebook-convert
|
||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
with:
|
||||
packages: calibre
|
||||
|
||||
# HonKit uses highlight.js for syntax highlighting, which doesn't have
|
||||
# "assembly" option, but has "x86asm". Currently, there is a better
|
||||
# "x86asmatt" option in main branch but it is unreleased.
|
||||
- name: Change highlighting code for honkit
|
||||
run: find . -type f -name "*.md" -exec sed -i 's/```assembly/```x86asm/g' {} \;
|
||||
|
||||
# Create environment variables for convenience.
|
||||
# GITHUB_ENV stores the env variables between steps.
|
||||
- name: Get commit hash and create filename prefix
|
||||
run: |
|
||||
commit="$(git rev-parse --short HEAD)"
|
||||
echo "commit=$commit" >> $GITHUB_ENV
|
||||
echo "filename_prefix='linux-insides_$commit'" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate PDF
|
||||
run: honkit pdf ./ "./$filename_prefix.pdf"
|
||||
|
||||
- name: Generate EPUB
|
||||
run: honkit epub ./ "./$filename_prefix.epub"
|
||||
|
||||
- name: Generate MOBI
|
||||
run: honkit mobi ./ "./$filename_prefix.mobi"
|
||||
|
||||
# Create a release on GitHub.
|
||||
- name: Create release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "${{ env.filename_prefix }}.*"
|
||||
generateReleaseNotes: true
|
||||
allowUpdates: true
|
||||
artifactErrorsFailBuild: true
|
||||
tag: "${{ env.commit }}"
|
||||
commit: "master"
|
||||
# End of steps.
|
||||
# End of release_ebooks.
|
||||
# End of jobs.
|
||||
|
||||
|
||||
# End of file.
|
@ -7,7 +7,7 @@ A book-in-progress about the linux kernel and its insides.
|
||||
|
||||
**Questions/Suggestions**: Feel free about any questions or suggestions by pinging me at twitter [@0xAX](https://twitter.com/0xAX), adding an [issue](https://github.com/0xAX/linux-insides/issues/new) or just drop me an [email](mailto:anotherworldofworld@gmail.com).
|
||||
|
||||
Generating eBooks and PDFs - [documentation](https://github.com/GitbookIO/gitbook/blob/master/docs/ebook.md)
|
||||
PDF, EPUB, and MOBI files can be downloaded from the [releases page](https://github.com/0xAX/linux-insides/releases).
|
||||
|
||||
# Mailing List
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user