From dcd361de964f4bad6d4228d51e09d9fcfd13f4da Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 3 Jun 2025 18:17:37 +0200 Subject: [PATCH 01/23] ci: parallelize the mdbook build process --- .github/workflows/build.sh | 13 +++++++++++++ .github/workflows/publish.yml | 8 +++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index 5569b290c228..c2d637cf694f 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -15,6 +15,19 @@ set -Eeuo pipefail book_lang=${1:?"Usage: $0 "} dest_dir=${2:?"Usage: $0 "} +# ensure source dir exists +mkdir -p source +# clean previous build artifacts +SOURCE_DIR="source/${book_lang}" +rm -rf "$SOURCE_DIR" +mkdir "$SOURCE_DIR" + +# clone the current state into the source directory +git clone . "$SOURCE_DIR" + +# now work from that new directory as the base directory +cd "$SOURCE_DIR" + if [ "$book_lang" = "en" ]; then echo "::group::Building English course" else diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cf6daa309102..aa2a45e7d0bc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,12 +53,10 @@ jobs: run: .github/workflows/build.sh en book - name: Build all translations + # note: build.sh here uses the given book path relative to source/{language} run: | - for po_lang in ${{ env.LANGUAGES }}; do - .github/workflows/build.sh $po_lang book/$po_lang - mv book/$po_lang/html book/html/$po_lang - done - + parallel -i .github/workflows/build.sh {} book/{} -- ${{ env.LANGUAGES }} + parallel -i mv source/{}/book/{}/html book/html/{} -- ${{ env.LANGUAGES }} - name: Build translation report run: i18n-report report book/html/translation-report.html po/*.po From 8a4d79d4dc34518d9e3df6df74b2e369ba0f31ba Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 3 Jun 2025 18:29:39 +0200 Subject: [PATCH 02/23] test the publish process without actually publishing by removing permissions and publish steps --- .github/workflows/publish.yml | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aa2a45e7d0bc..ed6c9d2051e5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,21 +3,12 @@ name: Publish # See also TRANSLATIONS.md. on: + pull_request: push: branches: - main workflow_dispatch: -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: pages - cancel-in-progress: true - env: CARGO_TERM_COLOR: always # Update the language picker in index.hbs to link new languages. @@ -25,9 +16,6 @@ env: jobs: publish: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Checkout @@ -67,14 +55,15 @@ jobs: for file in synced-po/*.po; do msgmerge --update $file synced-po/messages.pot ; done i18n-report report book/html/synced-translation-report.html synced-po/*.po - - name: Setup Pages - uses: actions/configure-pages@v5 + # TODO: uncomment the following lines before merging into main. This is removed for development purposes. + # - name: Setup Pages + # uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v4 - with: - path: book/html + # - name: Upload artifact + # uses: actions/upload-pages-artifact@v4 + # with: + # path: book/html - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@v4 From 192154311ea1945549b7e45e8405003cc8bf5a43 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 3 Jun 2025 18:41:09 +0200 Subject: [PATCH 03/23] install parallel (with moreutils) --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ed6c9d2051e5..28258e92017b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,6 +43,7 @@ jobs: - name: Build all translations # note: build.sh here uses the given book path relative to source/{language} run: | + sudo apt install moreutils parallel -i .github/workflows/build.sh {} book/{} -- ${{ env.LANGUAGES }} parallel -i mv source/{}/book/{}/html book/html/{} -- ${{ env.LANGUAGES }} - name: Build translation report From 121cca35aec663688ce98003e22a3cc5b378de13 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 3 Jun 2025 18:53:56 +0200 Subject: [PATCH 04/23] use gnu parallel that is already installed --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 28258e92017b..74bd1a18f899 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,9 +43,8 @@ jobs: - name: Build all translations # note: build.sh here uses the given book path relative to source/{language} run: | - sudo apt install moreutils - parallel -i .github/workflows/build.sh {} book/{} -- ${{ env.LANGUAGES }} - parallel -i mv source/{}/book/{}/html book/html/{} -- ${{ env.LANGUAGES }} + parallel .github/workflows/build.sh {} book/{} ::: ${{ env.LANGUAGES }} + parallel mv source/{}/book/{}/html book/html/{} ::: ${{ env.LANGUAGES }} - name: Build translation report run: i18n-report report book/html/translation-report.html po/*.po From 436f84be9d7db3bb7fb59d2c84b0eb61ede0d21d Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 3 Jun 2025 19:38:43 +0200 Subject: [PATCH 05/23] english translation needs to be moved to correct directory --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 74bd1a18f899..9a915628049b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,8 +38,9 @@ jobs: uses: ./.github/workflows/install-mdbook - name: Build course in English - run: .github/workflows/build.sh en book - + run: | + .github/workflows/build.sh en book + mv source/en/book book - name: Build all translations # note: build.sh here uses the given book path relative to source/{language} run: | From eb4eccae7442933d7e12ccfa4f3abb952d488998 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 6 Jun 2025 10:21:36 +0200 Subject: [PATCH 06/23] Revert "english translation needs to be moved to correct directory" This reverts commit 8791e59cedcbf965914a32cb607cc7a07ea9800b. --- .github/workflows/publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9a915628049b..74bd1a18f899 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,9 +38,8 @@ jobs: uses: ./.github/workflows/install-mdbook - name: Build course in English - run: | - .github/workflows/build.sh en book - mv source/en/book book + run: .github/workflows/build.sh en book + - name: Build all translations # note: build.sh here uses the given book path relative to source/{language} run: | From 7120c331014390216ec0b87434f025121df946af Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 6 Jun 2025 10:21:48 +0200 Subject: [PATCH 07/23] Revert "use gnu parallel that is already installed" This reverts commit 2ee2402b257c4c691fc4894c799a078e55a70e53. --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 74bd1a18f899..28258e92017b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,8 +43,9 @@ jobs: - name: Build all translations # note: build.sh here uses the given book path relative to source/{language} run: | - parallel .github/workflows/build.sh {} book/{} ::: ${{ env.LANGUAGES }} - parallel mv source/{}/book/{}/html book/html/{} ::: ${{ env.LANGUAGES }} + sudo apt install moreutils + parallel -i .github/workflows/build.sh {} book/{} -- ${{ env.LANGUAGES }} + parallel -i mv source/{}/book/{}/html book/html/{} -- ${{ env.LANGUAGES }} - name: Build translation report run: i18n-report report book/html/translation-report.html po/*.po From bee9ae1a4c921424772ac160a0c628009a1fd34f Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 6 Jun 2025 10:22:05 +0200 Subject: [PATCH 08/23] Revert "install parallel (with moreutils)" This reverts commit de81b2fd9087e3623162b9778dfdc94a129b7be2. --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 28258e92017b..ed6c9d2051e5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,7 +43,6 @@ jobs: - name: Build all translations # note: build.sh here uses the given book path relative to source/{language} run: | - sudo apt install moreutils parallel -i .github/workflows/build.sh {} book/{} -- ${{ env.LANGUAGES }} parallel -i mv source/{}/book/{}/html book/html/{} -- ${{ env.LANGUAGES }} - name: Build translation report From b2de3ccb9cc799b2f06f8103caa723904e125b20 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 6 Jun 2025 10:22:22 +0200 Subject: [PATCH 09/23] Revert "ci: parallelize the mdbook build process" This reverts commit 9ad2542a2993951f1a240d7400aa31951e0e60d6. --- .github/workflows/build.sh | 13 ------------- .github/workflows/publish.yml | 8 +++++--- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index c2d637cf694f..5569b290c228 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -15,19 +15,6 @@ set -Eeuo pipefail book_lang=${1:?"Usage: $0 "} dest_dir=${2:?"Usage: $0 "} -# ensure source dir exists -mkdir -p source -# clean previous build artifacts -SOURCE_DIR="source/${book_lang}" -rm -rf "$SOURCE_DIR" -mkdir "$SOURCE_DIR" - -# clone the current state into the source directory -git clone . "$SOURCE_DIR" - -# now work from that new directory as the base directory -cd "$SOURCE_DIR" - if [ "$book_lang" = "en" ]; then echo "::group::Building English course" else diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ed6c9d2051e5..57852deca04c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,10 +41,12 @@ jobs: run: .github/workflows/build.sh en book - name: Build all translations - # note: build.sh here uses the given book path relative to source/{language} run: | - parallel -i .github/workflows/build.sh {} book/{} -- ${{ env.LANGUAGES }} - parallel -i mv source/{}/book/{}/html book/html/{} -- ${{ env.LANGUAGES }} + for po_lang in ${{ env.LANGUAGES }}; do + .github/workflows/build.sh $po_lang book/$po_lang + mv book/$po_lang/html book/html/$po_lang + done + - name: Build translation report run: i18n-report report book/html/translation-report.html po/*.po From a512b67f22abddd374f4ca0957f19492fdd5bcb9 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 6 Jun 2025 10:37:52 +0200 Subject: [PATCH 10/23] ci: Use a job matrix for translations and combine the artifacts in the publish job --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 57852deca04c..77e1806d1a03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,10 +12,12 @@ on: env: CARGO_TERM_COLOR: always # Update the language picker in index.hbs to link new languages. - LANGUAGES: ar bn da de el es fa fr id it ja ko pl pt-BR ro ru tr uk vi zh-CN zh-TW jobs: - publish: + create-translation: + strategy: + matrix: + language: ["en", "ar", "bn", "da", "de", "el", "es", "fa", "fr", "id", "it", "ja", "ko", "pl", "pt-BR", "ro", "ru", "tr", "uk", "vi", "zh-CN", "zh-TW"] runs-on: ubuntu-latest steps: - name: Checkout @@ -38,14 +40,32 @@ jobs: uses: ./.github/workflows/install-mdbook - name: Build course in English + if: matrix.language == 'en' run: .github/workflows/build.sh en book - - name: Build all translations + - name: Build ${{ matrix.language }} translation + if: matrix.language != 'en' run: | - for po_lang in ${{ env.LANGUAGES }}; do - .github/workflows/build.sh $po_lang book/$po_lang - mv book/$po_lang/html book/html/$po_lang - done + .github/workflows/build.sh ${{ matrix.language }} book/${{ matrix.language }} + mkdir book/html + mv book/${{ matrix.language }}/html book/html/${{ matrix.language }} + + - name: Upload translation + uses: actions/upload-artifact@v4 + with: + name: comprehensive-rust-${{ matrix.language }} + path: book/ + + publish: + runs-on: ubuntu-latest + needs: create-translation + steps: + - name: Download all translations + uses: actions/download-artifact@v4 + with: + path: book/ + pattern: comprehensive-rust-* + merge-multiple: true - name: Build translation report run: i18n-report report book/html/translation-report.html po/*.po @@ -57,6 +77,12 @@ jobs: for file in synced-po/*.po; do msgmerge --update $file synced-po/messages.pot ; done i18n-report report book/html/synced-translation-report.html synced-po/*.po + # TODO: remove this before merging into main. This is just for verification of the build result while developing this workflow. + - name: Upload all translations (for verification) + uses: actions/upload-artifact@v4 + with: + name: comprehensive-rust-all + path: book/ # TODO: uncomment the following lines before merging into main. This is removed for development purposes. # - name: Setup Pages # uses: actions/configure-pages@v5 From 968b7dd5a1aabc46fe5ba5cc6cfdec461ece4c24 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 10 Jun 2025 10:49:16 +0200 Subject: [PATCH 11/23] install i18n-report (via install-mdbook step) in publish job --- .github/workflows/publish.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 77e1806d1a03..e93ae56434bb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -60,6 +60,15 @@ jobs: runs-on: ubuntu-latest needs: create-translation steps: + - name: Update Rust + run: rustup update + + - name: Setup Rust cache + uses: ./.github/workflows/setup-rust-cache + + - name: Install mdbook + uses: ./.github/workflows/install-mdbook + - name: Download all translations uses: actions/download-artifact@v4 with: From 33f148f020674a5b758f9406f440dbc45fbdeab6 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 10 Jun 2025 10:59:30 +0200 Subject: [PATCH 12/23] satisfy our pushy dprint --- .github/workflows/publish.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e93ae56434bb..1923337a8d7c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,31 @@ jobs: create-translation: strategy: matrix: - language: ["en", "ar", "bn", "da", "de", "el", "es", "fa", "fr", "id", "it", "ja", "ko", "pl", "pt-BR", "ro", "ru", "tr", "uk", "vi", "zh-CN", "zh-TW"] + language: + [ + "en", + "ar", + "bn", + "da", + "de", + "el", + "es", + "fa", + "fr", + "id", + "it", + "ja", + "ko", + "pl", + "pt-BR", + "ro", + "ru", + "tr", + "uk", + "vi", + "zh-CN", + "zh-TW", + ] runs-on: ubuntu-latest steps: - name: Checkout From 758505a24532b73e0ec5510dbfac8efec3de88b6 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Tue, 10 Jun 2025 16:40:46 +0200 Subject: [PATCH 13/23] add checkout action --- .github/workflows/publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1923337a8d7c..e2d3ee84b8ea 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -84,6 +84,9 @@ jobs: runs-on: ubuntu-latest needs: create-translation steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Update Rust run: rustup update From 7b84b06e96abc904d0111538bfc7233ebb6a110b Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 12 Jun 2025 15:38:33 +0200 Subject: [PATCH 14/23] install gettext for msgmerge --- .github/workflows/publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e2d3ee84b8ea..c3ae05f2acbc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -93,6 +93,11 @@ jobs: - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache + - name: Install Gettext + run: | + sudo apt update + sudo apt install gettext + - name: Install mdbook uses: ./.github/workflows/install-mdbook From 452592924f05fc1bc5983db9c595eb913892e260 Mon Sep 17 00:00:00 2001 From: michael-kerscher Date: Thu, 4 Sep 2025 15:14:35 +0200 Subject: [PATCH 15/23] make YAML more simple --- .github/workflows/publish.yml | 46 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3ae05f2acbc..5bcda0c0653e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,30 +18,28 @@ jobs: strategy: matrix: language: - [ - "en", - "ar", - "bn", - "da", - "de", - "el", - "es", - "fa", - "fr", - "id", - "it", - "ja", - "ko", - "pl", - "pt-BR", - "ro", - "ru", - "tr", - "uk", - "vi", - "zh-CN", - "zh-TW", - ] + - "en" + - "ar" + - "bn" + - "da" + - "de" + - "el" + - "es" + - "fa" + - "fr" + - "id" + - "it" + - "ja" + - "ko" + - "pl" + - "pt-BR" + - "ro" + - "ru" + - "tr" + - "uk" + - "vi" + - "zh-CN" + - "zh-TW" runs-on: ubuntu-latest steps: - name: Checkout From 33bd1a8f60ae3ef156d4f8d07762ea8f193f28f0 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 4 Sep 2025 15:40:31 +0200 Subject: [PATCH 16/23] Upload the already built i18n-report binary and download it in later steps. This should be a massive performance gain in the publish step as we don't build several rust tools from scratch anymore for each language --- .github/workflows/publish.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5bcda0c0653e..6777d1a8b4b1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -61,6 +61,12 @@ jobs: - name: Install mdbook uses: ./.github/workflows/install-mdbook + - name: Upload i18n-report for the publish step + uses: actions/upload-artifact@v4 + with: + name: tool-i18n-report + path: .cargo/bin/i18n-report + - name: Build course in English if: matrix.language == 'en' run: .github/workflows/build.sh en book @@ -88,16 +94,11 @@ jobs: - name: Update Rust run: rustup update - - name: Setup Rust cache - uses: ./.github/workflows/setup-rust-cache - - - name: Install Gettext - run: | - sudo apt update - sudo apt install gettext - - - name: Install mdbook - uses: ./.github/workflows/install-mdbook + - name: Download i18n-report + uses: actions/download-artifact@v4 + with: + path: .cargo/bin + name: tool-i18n-report - name: Download all translations uses: actions/download-artifact@v4 From 4392e6b1f44a337d126666f4474705d4e9f0dc23 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 4 Sep 2025 16:05:27 +0200 Subject: [PATCH 17/23] pre-build tools in a separate compile build-tools step --- .github/workflows/publish.yml | 44 +++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6777d1a8b4b1..0b4ea27093dd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,32 @@ env: # Update the language picker in index.hbs to link new languages. jobs: + compile-build-tools: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Update Rust + run: rustup update + + - name: Setup Rust cache + uses: ./.github/workflows/setup-rust-cache + + - name: Install Gettext + run: | + sudo apt update + sudo apt install gettext + + - name: Install mdbook + uses: ./.github/workflows/install-mdbook + + - name: Upload pre-built-tools for the publish step + uses: actions/upload-artifact@v4 + with: + name: pre-built-tools + path: $HOME/.cargo/bin/ + create-translation: strategy: matrix: @@ -41,6 +67,7 @@ jobs: - "zh-CN" - "zh-TW" runs-on: ubuntu-latest + needs: compile-build-tools steps: - name: Checkout uses: actions/checkout@v5 @@ -58,14 +85,11 @@ jobs: with: packages: gettext - - name: Install mdbook - uses: ./.github/workflows/install-mdbook - - - name: Upload i18n-report for the publish step - uses: actions/upload-artifact@v4 + - name: Download pre-built tools + uses: actions/download-artifact@v4 with: - name: tool-i18n-report - path: .cargo/bin/i18n-report + name: pre-built-tools + path: $HOME/.cargo/bin/ - name: Build course in English if: matrix.language == 'en' @@ -94,11 +118,11 @@ jobs: - name: Update Rust run: rustup update - - name: Download i18n-report + - name: Download pre-built tools uses: actions/download-artifact@v4 with: - path: .cargo/bin - name: tool-i18n-report + path: $HOME/.cargo/bin/ + name: pre-built-tools - name: Download all translations uses: actions/download-artifact@v4 From bef01c49b954cb97fbcb45b6f4babdd9248e1f35 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 4 Sep 2025 16:09:39 +0200 Subject: [PATCH 18/23] use a better description --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0b4ea27093dd..f51b2f27c7ec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: - name: Install mdbook uses: ./.github/workflows/install-mdbook - - name: Upload pre-built-tools for the publish step + - name: Upload pre-built-tools for the next tasks uses: actions/upload-artifact@v4 with: name: pre-built-tools From 23b92472ed9e9c00c78c0871e89178478583e277 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 4 Sep 2025 16:24:37 +0200 Subject: [PATCH 19/23] hardcode home directory for the runner. Directory was taken from rust build/install logs --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f51b2f27c7ec..86b8755b4a08 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,7 +38,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: pre-built-tools - path: $HOME/.cargo/bin/ + path: /home/runner/.cargo/bin/ create-translation: strategy: @@ -89,7 +89,7 @@ jobs: uses: actions/download-artifact@v4 with: name: pre-built-tools - path: $HOME/.cargo/bin/ + path: /home/runner/.cargo/bin/ - name: Build course in English if: matrix.language == 'en' @@ -121,7 +121,7 @@ jobs: - name: Download pre-built tools uses: actions/download-artifact@v4 with: - path: $HOME/.cargo/bin/ + path: /home/runner/.cargo/bin/ name: pre-built-tools - name: Download all translations From 7c50b36f7b6b6cdaf1704823179c0fbcbf411122 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 4 Sep 2025 16:44:14 +0200 Subject: [PATCH 20/23] fix permission issues (binaries have not been executable due to zipping that does not preserve permissions) --- .github/workflows/publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 86b8755b4a08..b4675b3aeb9a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -91,6 +91,9 @@ jobs: name: pre-built-tools path: /home/runner/.cargo/bin/ + - name: Make all downloaded tools executable + run: chmod +x /home/runner/.cargo/bin/* + - name: Build course in English if: matrix.language == 'en' run: .github/workflows/build.sh en book @@ -123,6 +126,9 @@ jobs: with: path: /home/runner/.cargo/bin/ name: pre-built-tools + + - name: Make all downloaded tools executable + run: chmod +x /home/runner/.cargo/bin/* - name: Download all translations uses: actions/download-artifact@v4 From 0eabe548e27ce64595f6c3fda88c861fe6dbc323 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Thu, 4 Sep 2025 17:08:31 +0200 Subject: [PATCH 21/23] install mdbook-pandoc dependencies in create-translation This needs to be refactored later --- .github/workflows/publish.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b4675b3aeb9a..cd8edbf6a95b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,7 +32,7 @@ jobs: sudo apt install gettext - name: Install mdbook - uses: ./.github/workflows/install-mdbook + run: cargo xtask install-tools - name: Upload pre-built-tools for the next tasks uses: actions/upload-artifact@v4 @@ -94,6 +94,14 @@ jobs: - name: Make all downloaded tools executable run: chmod +x /home/runner/.cargo/bin/* + - name: Install dependencies for mdbook-pandoc + run: | + sudo apt-get update + sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto + curl -LsSf https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-linux-amd64.tar.gz | tar zxf - + echo "$PWD/pandoc-3.7.0.1/bin" >> $GITHUB_PATH + shell: bash + - name: Build course in English if: matrix.language == 'en' run: .github/workflows/build.sh en book From 35ebe1825774a99f03137c0356b0e0af195391a3 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 5 Sep 2025 10:19:06 +0200 Subject: [PATCH 22/23] evaluate install-action github action --- .github/workflows/publish.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cd8edbf6a95b..1be8f6d4e002 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,10 +26,17 @@ jobs: - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache - - name: Install Gettext - run: | - sudo apt update - sudo apt install gettext + - name: Install build tools + uses: taiki-e/install-action@v2 + with: + # testing without version first but should be + # mdbook@0.4.48 + # mdbook-svgbob@0.2.2 + # mdbook-pandoc@0.10.4 + # mdbook-i18n-helpers@0.3.6 + # i18n-report@0.2.0 + # mdbook-linkcheck2@0.9.1 + tool: mdbook,mdbook-svgbob,mdbook-pandoc,mdbook-i18n-helpers,i18n-report,mdbook-linkcheck2 - name: Install mdbook run: cargo xtask install-tools @@ -138,6 +145,11 @@ jobs: - name: Make all downloaded tools executable run: chmod +x /home/runner/.cargo/bin/* + - name: Install Gettext + run: | + sudo apt update + sudo apt install gettext + - name: Download all translations uses: actions/download-artifact@v4 with: From 49da39b659f35b0a4178f45b524c5db07ff15569 Mon Sep 17 00:00:00 2001 From: Michael Kerscher Date: Fri, 19 Sep 2025 10:56:56 +0200 Subject: [PATCH 23/23] Remove rust binary precompilation step. The install-mdbook step now uses --binstall where available. Once we build more binaries for our dependencies, this becomes faster without further work --- .github/workflows/publish.yml | 64 +++-------------------------------- 1 file changed, 5 insertions(+), 59 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1be8f6d4e002..eaed9a927e7b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,39 +14,6 @@ env: # Update the language picker in index.hbs to link new languages. jobs: - compile-build-tools: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Update Rust - run: rustup update - - - name: Setup Rust cache - uses: ./.github/workflows/setup-rust-cache - - - name: Install build tools - uses: taiki-e/install-action@v2 - with: - # testing without version first but should be - # mdbook@0.4.48 - # mdbook-svgbob@0.2.2 - # mdbook-pandoc@0.10.4 - # mdbook-i18n-helpers@0.3.6 - # i18n-report@0.2.0 - # mdbook-linkcheck2@0.9.1 - tool: mdbook,mdbook-svgbob,mdbook-pandoc,mdbook-i18n-helpers,i18n-report,mdbook-linkcheck2 - - - name: Install mdbook - run: cargo xtask install-tools - - - name: Upload pre-built-tools for the next tasks - uses: actions/upload-artifact@v4 - with: - name: pre-built-tools - path: /home/runner/.cargo/bin/ - create-translation: strategy: matrix: @@ -74,7 +41,6 @@ jobs: - "zh-CN" - "zh-TW" runs-on: ubuntu-latest - needs: compile-build-tools steps: - name: Checkout uses: actions/checkout@v5 @@ -92,22 +58,8 @@ jobs: with: packages: gettext - - name: Download pre-built tools - uses: actions/download-artifact@v4 - with: - name: pre-built-tools - path: /home/runner/.cargo/bin/ - - - name: Make all downloaded tools executable - run: chmod +x /home/runner/.cargo/bin/* - - - name: Install dependencies for mdbook-pandoc - run: | - sudo apt-get update - sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto - curl -LsSf https://github.com/jgm/pandoc/releases/download/3.7.0.1/pandoc-3.7.0.1-linux-amd64.tar.gz | tar zxf - - echo "$PWD/pandoc-3.7.0.1/bin" >> $GITHUB_PATH - shell: bash + - name: Install mdbook + uses: ./.github/workflows/install-mdbook - name: Build course in English if: matrix.language == 'en' @@ -136,20 +88,14 @@ jobs: - name: Update Rust run: rustup update - - name: Download pre-built tools - uses: actions/download-artifact@v4 - with: - path: /home/runner/.cargo/bin/ - name: pre-built-tools - - - name: Make all downloaded tools executable - run: chmod +x /home/runner/.cargo/bin/* - - name: Install Gettext run: | sudo apt update sudo apt install gettext + - name: Install mdbook + uses: ./.github/workflows/install-mdbook + - name: Download all translations uses: actions/download-artifact@v4 with: