20240530 - v1.3.2 #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build ebook | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r script/requirements.txt | |
- name: Build epub | |
run: | | |
python script/make_epub.py | |
- name: Download chmcmd | |
run: | | |
curl https://github.com/skywind3000/support/releases/download/1.0.0/chmcmd.zip -L > chmcmd.zip | |
7z x chmcmd.zip | |
copy chmcmd.exe .\build\ | |
ls | |
- name: Build chm | |
run: | | |
$env:Path += ';.;.\HHW' | |
python script\make_chm.py | |
- name: Clear up | |
run: | | |
Remove-Item -Path build\html -Recurse -Force | |
Remove-Item -Path build\images -Recurse -Force | |
Remove-Item -Path build\doc -Recurse -Force | |
Remove-Item -Path build\*.exe -Recurse -Force | |
Remove-Item -Path build\chm.hh* -Recurse -Force | |
- name: Rename files | |
run: | | |
mv build\GONGLUE.chm build\GONGLUE-$(Get-Date -f "yyyyMMdd").chm | |
mv build\GONGLUE.epub build\GONGLUE-$(Get-Date -f "yyyyMMdd").epub | |
- name: Check output | |
run: ls build | |
- name: Upload result | |
uses: actions/[email protected] | |
with: | |
# name: # optional, default is artifact | |
path: build | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
generate_release_notes: true | |
files: build/* | |