-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build and Release mdbook | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Install mdbook | ||
run: | | ||
mkdir bin | ||
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.42/mdbook-v0.4.42-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin | ||
echo "$(pwd)/bin" >> ${GITHUB_PATH} | ||
- name: Install mdbook-i18n-helpers | ||
run: | | ||
cargo install mdbook-i18n-helpers --locked --version 0.3.4 | ||
- name: Install mdbook-cairo | ||
run: | | ||
cargo install --git https://github.com/enitrat/mdbook-cairo | ||
- name: Install asdf & tools | ||
uses: asdf-vm/actions/install@v3 | ||
|
||
- name: Set default scarb version | ||
run: asdf global scarb $(cat .tool-versions | grep scarb | cut -d ' ' -f 2) | ||
|
||
- name: Set default starknet-foundry version | ||
run: asdf global starknet-foundry $(cat .tool-versions | grep starknet-foundry | cut -d ' ' -f 2) | ||
|
||
- name: Add binary paths to PATH | ||
run: | | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
- name: Build book (English) | ||
run: mdbook build -d book | ||
|
||
- name: Create ZIP file | ||
run: zip -r markdown-output.zip book/markdown | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: markdown-output.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |