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