Skip to content

Commit

Permalink
ci: release GHA (cairo-book#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Mar 20, 2024
1 parent f6530f1 commit 649c599
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Release mdbook

permissions:
contents: write

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Rust cache
uses: ./.github/workflows/setup-rust-cache

- name: Install mdbook
uses: ./.github/workflows/install-mdbook

- name: Build book (English)
run: mdbook build -d book

- name: Create ZIP file
run: zip -r markdown-output.zip book/markdown

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./markdown-output.zip
asset_name: markdown-output.zip
asset_content_type: application/zip

0 comments on commit 649c599

Please sign in to comment.