From 649c599ffdb10678fa2146ab52768efaaefd64c9 Mon Sep 17 00:00:00 2001 From: Mathieu <60658558+enitrat@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:16:25 +0100 Subject: [PATCH] ci: release GHA (#689) --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..f9cd44bd1 --- /dev/null +++ b/.github/workflows/release.yml @@ -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