From 362e1be58d2b7008dca9b43f9e338b51b4ab885d Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:32:35 +0100 Subject: [PATCH] ci: get documentation `tuono` version automatically (#462) --- .github/workflows/documentation-ci.yml | 10 +++++++++- .github/workflows/documentation-deploy.yml | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation-ci.yml b/.github/workflows/documentation-ci.yml index 8065b7ff..6f3abd13 100644 --- a/.github/workflows/documentation-ci.yml +++ b/.github/workflows/documentation-ci.yml @@ -40,8 +40,16 @@ jobs: - name: Setup rust uses: actions-rust-lang/setup-rust-toolchain@v1 + # ⬇️ Keep in sync with `.github/workflows/deploy-documentation.yml` + - name: Read tuono version used by the documentation + id: get_tuono_version + run: | + VERSION=$(pnpm ls tuono --filter=documentation | grep "tuono " | sed -E 's/.* ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Install tuono - run: cargo install tuono@0.17.6 + run: cargo install tuono@${{ steps.get_tuono_version.outputs.version }} + # ⬆️ - name: Build project working-directory: ./apps/documentation diff --git a/.github/workflows/documentation-deploy.yml b/.github/workflows/documentation-deploy.yml index cb238c3d..93701728 100644 --- a/.github/workflows/documentation-deploy.yml +++ b/.github/workflows/documentation-deploy.yml @@ -1,4 +1,4 @@ -name: Deploy documentation website on AWS S3 +name: Documentation Website Deploy on AWS S3 on: push: @@ -26,8 +26,16 @@ jobs: - name: Setup rust uses: actions-rust-lang/setup-rust-toolchain@v1 + # ⬇️ Keep in sync with `.github/workflows/ci-documentation.yml` + - name: Read tuono version used by the documentation + id: get_tuono_version + run: | + VERSION=$(pnpm ls tuono --filter=documentation | grep "tuono " | sed -E 's/.* ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Install tuono - run: cargo install tuono@0.17.6 + run: cargo install tuono@${{ steps.get_tuono_version.outputs.version }} + # ⬆️ - name: Build project working-directory: ./apps/documentation