Skip to content

Commit

Permalink
Merge pull request #645 from ferllop/master
Browse files Browse the repository at this point in the history
Update build workflow to run properly
  • Loading branch information
KtorZ authored Dec 8, 2023
2 parents 8a23c7d + b0b9d82 commit e5aa315
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ on:
branches:
- master

env:
BOOK_FILENAME: mostly-adequate-guide-to-functional-programming

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.1

- name: Install Calibre
run: |
sudo apt install -y libopengl0 libegl1 libxcb-cursor0
wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
mkdir -p ~/.local/bin
ln -s /opt/calibre/calibre ~/.local/bin/calibre
Expand All @@ -24,6 +28,10 @@ jobs:
with:
node-version: 10.22.1

- name: Generate summary
run: |
npm run generate-summary
- name: Setup gitbook
run: |
npm install
Expand All @@ -32,29 +40,29 @@ jobs:
- name: Generate PDF
run: |
npm run generate-pdf
mv book.pdf mostly-adequate-guide-to-functional-programming.pdf
mv book.pdf ${BOOK_FILENAME}.pdf
- name: Generate EPUB
run: |
npm run generate-epub
mv book.epub mostly-adequate-guide-to-functional-programming.epub
mv book.epub ${BOOK_FILENAME}.epub
- uses: actions/upload-artifact@v2
with:
name: PDF
path: mostly-adequate-guide-to-functional-programming.pdf
path: ${{ env.BOOK_FILENAME }}.pdf

- uses: actions/upload-artifact@v2
with:
name: EPUB
path: mostly-adequate-guide-to-functional-programming.epub
path: ${{ env.BOOK_FILENAME }}.epub

- run: echo "::set-output name=ID::$(git describe --tags --always)"
- run: echo "ID=$(git describe --tags --always)" >> $GITHUB_OUTPUT
id: release-id

- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release-id.outputs.ID }}
files: |
mostly-adequate-guide-to-functional-programming.pdf
mostly-adequate-guide-to-functional-programming.epub
${{ env.BOOK_FILENAME }}.pdf
${{ env.BOOK_FILENAME }}.epub
15 changes: 14 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@
* [No Law and Order](ch12.md#no-law-and-order)
* [In Summary](ch12.md#in-summary)
* [Exercises](ch12.md#exercises)
* [Chapter 13: Monoids bring it all together](ch13.md)
* [Wild combination](ch13.md#wild-combination)
* [Abstracting addition](ch13.md#abstracting-addition)
* [All my favourite functors are semigroups.](ch13.md#all-my-favourite-functors-are-semigroups)
* [Monoids for nothing](ch13.md#monoids-for-nothing)
* [Folding down the house](ch13.md#folding-down-the-house)
* [Not quite a monoid](ch13.md#not-quite-a-monoid)
* [Grand unifying theory](ch13.md#grand-unifying-theory)
* [Group theory or Category theory?](ch13.md#group-theory-or-category-theory)
* [In summary](ch13.md#in-summary)
* [Exercises](ch13.md#exercises)
* [Appendix A: Essential Functions Support](appendix_a.md)
* [always](appendix_a.md#always)
* [compose](appendix_a.md#compose)
Expand All @@ -93,7 +104,8 @@
* [identity](appendix_a.md#identity)
* [inspect](appendix_a.md#inspect)
* [left](appendix_a.md#left)
* [liftA\*](appendix_a.md#lifta)
* [liftA2](appendix_a.md#lifta2)
* [liftA3](appendix_a.md#lifta3)
* [maybe](appendix_a.md#maybe)
* [nothing](appendix_a.md#nothing)
* [reject](appendix_a.md#reject)
Expand Down Expand Up @@ -124,6 +136,7 @@
* [prop](appendix_c.md#prop)
* [reduce](appendix_c.md#reduce)
* [replace](appendix_c.md#replace)
* [reverse](appendix_c.md#reverse)
* [safeHead](appendix_c.md#safehead)
* [safeLast](appendix_c.md#safelast)
* [safeProp](appendix_c.md#safeprop)
Expand Down
3 changes: 2 additions & 1 deletion book.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"cover": "images/cover.png",
"plugins": [
"exercises@git+https://github.com/MostlyAdequate/plugin-exercises.git",
"include-codeblock@3.1.2"
"include-codeblock@3.2.2"
]
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "The Mostly Adequate Guide to Functional Programming",
"dependencies": {
"gitbook-plugin-include-codeblock": "^3.2.2",
"gitbook-plugin-exercises": "MostlyAdequate/plugin-exercises"
"gitbook-plugin-exercises": "git+https://github.com/MostlyAdequate/plugin-exercises.git"
},
"devDependencies": {
"gitbook-cli": "^2.3.2"
Expand Down

0 comments on commit e5aa315

Please sign in to comment.