Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust translation build on CI #1849

Merged
merged 1 commit into from
May 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/rbe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,22 @@ jobs:
- name: Build all translations
run: |
for po_lang in ${{ env.LANGUAGES }}; do
POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/')
if [[ $POT_CREATION_DATE == "" ]]; then
POT_CREATION_DATE=now
fi

echo "::group::Building $po_lang translation as of $POT_CREATION_DATE"
rm -r src/
git restore --source "$(git rev-list -n 1 --before "$POT_CREATION_DATE" @)" src/

echo "::group::Building $po_lang translation"
# Set language and adjust site URL. Clear the redirects
# since they are in sync with the source files, not the
# translation.
MDBOOK_BOOK__LANGUAGE=$po_lang \
MDBOOK_OUTPUT__HTML__SITE_URL=/rust-by-example/$po_lang/ \
MDBOOK_OUTPUT__HTML__REDIRECT='{}' \
mdbook build -d book/$po_lang
echo "::endgroup::"
done

- name: Check all translations for broken links
run: |
for po_lang in ${{ env.LANGUAGES }}; do
MDBOOK_BOOK__LANGUAGE=$po_lang \
sh linkcheck.sh --all rust-by-example
done

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
Loading