5555 name : blockchain_guide-pdf
5656 path : " blockchain_guide-*.pdf"
5757
58- release :
59- name : Create release
60- needs : build-pdf
61- runs-on : ubuntu-latest
62- if : startsWith(github.ref, 'refs/tags/')
63- permissions :
64- contents : write
65- steps :
66- - name : Download PDF artifact
67- uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
68- with :
69- name : blockchain_guide-pdf
70- path : dist
71-
72- - name : Create Release with PDF
73- uses : softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
74- with :
75- generate_release_notes : true
76- files : " dist/blockchain_guide-*.pdf"
77-
7858 - name : Build HTML reader
7959 id : htmlreader
8060 continue-on-error : true
@@ -86,22 +66,44 @@ jobs:
8666 sudo dpkg -i /tmp/pandoc.deb && pandoc --version | head -1
8767 PUPPETEER_SKIP_DOWNLOAD=true npm install -g @mermaid-js/mermaid-cli@10
8868 TITLE=$(python3 -c "import json,os;print((json.load(open('book.json')).get('title') if os.path.exists('book.json') else '') or '${{ github.event.repository.name }}')")
89- TAG=$(echo "${{ steps.tag.outputs.TAG_NAME || 'latest' }}" | sed 's#.*/##') # slash-free (handles non-tag dispatch)
69+ TAG=$(echo "${{ steps.tag.outputs.TAG_NAME || 'latest' }}" | sed 's#.*/##')
9070 python3 tools/render_mermaid.py --book-dir . --svg-out /tmp/mmsvg
9171 python3 tools/build_html_reader.py --book-dir . --title "$TITLE" --svg-dir /tmp/mmsvg \
9272 --out "${{ github.event.repository.name }}-${TAG}.html"
9373 ls -lh ${{ github.event.repository.name }}-${TAG}.html
9474
95- - name : Attach HTML to release
96- if : steps.htmlreader.outcome == 'success' && startsWith(github.ref, 'refs/tags/')
97- uses : softprops/action-gh-release@v2
98- with :
99- tag_name : ${{ steps.tag.outputs.TAG_NAME }}
100- files : " ${{ github.event.repository.name }}-${{ steps.tag.outputs.TAG_NAME }}.html"
101-
10275 - name : Upload HTML as artifact
10376 if : steps.htmlreader.outcome == 'success'
10477 uses : actions/upload-artifact@v7
10578 with :
10679 name : html-edition
10780 path : " ${{ github.event.repository.name }}-*.html"
81+
82+ release :
83+ name : Create release
84+ needs : build-pdf
85+ runs-on : ubuntu-latest
86+ if : startsWith(github.ref, 'refs/tags/')
87+ permissions :
88+ contents : write
89+ steps :
90+ - name : Download PDF artifact
91+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
92+ with :
93+ name : blockchain_guide-pdf
94+ path : dist
95+
96+ - name : Download HTML artifact
97+ continue-on-error : true
98+ uses : actions/download-artifact@v7
99+ with :
100+ name : html-edition
101+ path : dist
102+
103+ - name : Create Release with PDF and HTML
104+ uses : softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
105+ with :
106+ generate_release_notes : true
107+ files : |
108+ dist/blockchain_guide-*.pdf
109+ dist/*.html
0 commit comments