-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (72 loc) · 2.38 KB
/
document.yaml
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
name: Build document
on: [ push, create ]
env:
DOC_BASE: ./
RELEASE_VERSION: ${GITHUB_REF#refs/*/}
DOWNLOAD_URL_BASE: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download
jobs:
make-document:
name: Compile document
runs-on: ubuntu-latest
container:
image: k4zuki/pandocker-alpine:2.19
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup safe directory for git
run: |
repo=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
git config --global --add safe.directory /__w/${repo}/${repo}
- name: Update dependencies
run: |
pip3 install pandocker-lua-filters docx-coreprop-writer
pip3 install git+https://github.com/k4zuki/[email protected]
- name: Prepare QR code for this build (at a tag)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
pip3 install qrcode
make initdir html
TARGET=`ls ${{env.DOC_BASE}}/Out/*.html`
TARGET=${TARGET#${{env.DOC_BASE}}/Out}
qr ${{env.DOWNLOAD_URL_BASE}}/${{env.RELEASE_VERSION}}/${TARGET//.html/}.pdf > ${{env.DOC_BASE}}/images/QRcode.png
- name: Build document
run: |
make initdir html docx
- name: Upload artifact files (at a push)
uses: actions/upload-artifact@v3
with:
path: ${{ env.DOC_BASE }}/Out
docx2pdf:
name: Docx to PDF conversion and release
runs-on: windows-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Wait for artifact build
uses: yogeshlonkar/wait-for-jobs@v0
with:
jobs: "Compile document"
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: ls
run: ls -R
- name: Install Office
run: choco install office365business # This takes about 5min
- name: docx2pdf
run: |
cd artifact
../docx2pdf/docx2pdf.ps1
- name: Make a release
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*.docx
artifact/*.html
artifact/*.pdf