lzanini / mdbook-katex

A preprocessor for mdBook, rendering LaTex equations to HTML at build time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move version number of uploaded binaries into a directory within the archive

expikr opened this issue · comments

commented

The following link format always points to the latest release tag:

https://github.com/{user}/{repo}/releases/latest/download/{file.ext}

If {file.ext} is a consistent name across versions, then this allows the link to always be a reliable download reference without needing to manually update CI every time the version number changes.

My suggestion, if a version number needs to be distributed with the file, would be to put the binary inside a folder with the version name, instead of in the archive name itself.

For example, current structure:

mdbook-katex-v0.3.14-x86_64-pc-windows-gnu.zip 
|- mdbook.exe

Proposed structure (option 1):

mdbook-katex-x86_64-pc-windows-gnu.zip 
|- mdbook-katex-v0.3.14-x86_64-pc-windows-gnu
   |- mdbook.exe

Or alternatively (option 2):

mdbook-katex-x86_64-pc-windows-gnu.zip 
|- v0.3.14
   |- mdbook.exe

Then CIs' can just do something like this:

KTX_LNK = https://github.com/lzanini/mdbook-katex/releases/latest/download/mdbook-katex-x86_64-pc-windows-gnu.zip
curl -o mdbook-katex.zip $KTX_LNK -J -L
tar -xf mdbook-katex.zip --strip-components=1