Skip to content

Commit

Permalink
dev: add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Feb 24, 2025
1 parent 07f6eae commit e55ff6e
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
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 }}

0 comments on commit e55ff6e

Please sign in to comment.