File tree Expand file tree Collapse file tree 1 file changed +74
-0
lines changed
Expand file tree Collapse file tree 1 file changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build latest tag
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ tags :
7+ - " v*.*.*"
8+
9+ jobs :
10+ build :
11+ name : Build
12+ runs-on : macos-latest
13+ steps :
14+ - name : checkout master
15+ uses : actions/checkout@v2
16+ with :
17+ ref : master
18+
19+ - name : install nodejs
20+ uses : actions/setup-node@v1
21+
22+ - name : install calibre
23+ run : |
24+ brew install calibre
25+
26+ - name : configue gitbook
27+ run : |
28+ npm install -g gitbook-cli
29+ gitbook install
30+ npm install -g gitbook-summary
31+
32+ - name : generate pdf file
33+ run : |
34+ book sm
35+ ln -s -f SUMMARY.md README.md
36+ gitbook pdf
37+ gitbook epub
38+ gitbook mobi
39+ mkdir -p path/to/artifact
40+ cp book.pdf path/to/artifact
41+ cp book.epub path/to/artifact
42+ cp book.mobi path/to/artifact
43+
44+ - name : Upload file
45+ uses : actions/upload-artifact@v2
46+ with :
47+ name : book.pdf
48+ path : path/to/artifact/book.pdf
49+
50+ - name : Download file
51+ id : download
52+ uses : actions/download-artifact@v2
53+ with :
54+ name : book.pdf
55+ path : path/to/artifact
56+
57+ - name : Display structure of downloaded files
58+ run : ls -R
59+ working-directory : path/to/artifact
60+
61+ - name : ' Echo download path'
62+ run : echo ${{steps.download.outputs.download-path}}
63+
64+ - name : Release
65+ uses : softprops/action-gh-release@v1
66+ if : startsWith(github.ref, 'refs/tags/')
67+ with :
68+ files : |
69+ path/to/artifact/book.pdf
70+ path/to/artifact/book.epub
71+ path/to/artifact/book.mobi
72+ LICENSE
73+ env :
74+ GITHUB_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
You can’t perform that action at this time.
0 commit comments