You've already forked uutils.github.io
mirror of
https://github.com/uutils/uutils.github.io.git
synced 2026-06-10 16:12:28 -07:00
96cc48809d
The l10n repo contains utilities (e.g. hashsum) that don't exist in the coreutils workspace. Copying entire directories created phantom workspace members that broke Cargo.
198 lines
5.6 KiB
YAML
198 lines
5.6 KiB
YAML
name: Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: "0 2 * * *"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build website artifacts
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout uutils.github.io Repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
repository: uutils/uutils.github.io
|
|
path: './uutils.github.io'
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout Coreutils Repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
repository: uutils/coreutils
|
|
path: './coreutils'
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout Coreutils L10n Repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
repository: uutils/coreutils-l10n
|
|
path: './coreutils-l10n'
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout Findutils Repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
repository: uutils/findutils
|
|
path: './findutils'
|
|
fetch-depth: 0
|
|
|
|
- name: Install `rust` toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install system deps
|
|
run: |
|
|
sudo apt install libacl1-dev libselinux1-dev libsystemd-dev man2html
|
|
|
|
- name: Install necessary tools (mdbook and mdbook-toc)
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: mdbook,mdbook-toc
|
|
|
|
- name: Copy l10n locales into coreutils
|
|
run: |
|
|
# Only copy locales into utilities that already exist in coreutils
|
|
for util_dir in coreutils-l10n/src/uu/*/; do
|
|
util=$(basename "$util_dir")
|
|
if [ -d "coreutils/src/uu/$util" ]; then
|
|
cp -r "$util_dir/locales" "coreutils/src/uu/$util/" 2>/dev/null || true
|
|
fi
|
|
done
|
|
cp -r coreutils-l10n/src/uucore/* coreutils/src/uucore/ 2>/dev/null || true
|
|
|
|
- name: Build Coreutils Docs
|
|
run: |
|
|
cd coreutils
|
|
curl -sfL https://github.com/tldr-pages/tldr/releases/download/v2.3/tldr-pages.zip -o docs/tldr.zip || true
|
|
cargo run --bin uudoc --all-features
|
|
cd docs
|
|
# Remove deprecated 'multilingual' field unsupported by newer mdbook
|
|
sed -i '/^multilingual/d' book.toml
|
|
mdbook build
|
|
|
|
- name: Build Coreutils Manpages (all languages)
|
|
run: |
|
|
uutils.github.io/scripts/build-all-manpages.sh coreutils manpages-html uutils.github.io/templates
|
|
|
|
- name: Build Findutils Docs
|
|
run: |
|
|
cd findutils/docs
|
|
# Remove deprecated 'multilingual' field unsupported by newer mdbook
|
|
sed -i '/^multilingual/d' book.toml
|
|
mdbook build
|
|
|
|
- name: Run Zola
|
|
uses: shalzz/zola-deploy-action@v0.21.0
|
|
env:
|
|
BUILD_DIR: uutils.github.io
|
|
BUILD_ONLY: true
|
|
|
|
- name: Collect results into `public` folder
|
|
run: |
|
|
cp -r uutils.github.io/public public
|
|
cp -r coreutils/docs/book public/coreutils/docs
|
|
cp -r findutils/docs/book public/findutils/docs
|
|
# Copy English manpages to /coreutils/manpages/
|
|
mkdir -p public/coreutils/manpages
|
|
cp -r manpages-html/en/* public/coreutils/manpages/
|
|
# Copy translated manpages to /coreutils/manpages-{lang}/
|
|
for lang_dir in manpages-html/*/; do
|
|
lang=$(basename "$lang_dir")
|
|
[ "$lang" = "en" ] && continue
|
|
mkdir -p "public/coreutils/manpages-${lang}"
|
|
cp -r "${lang_dir}"* "public/coreutils/manpages-${lang}/"
|
|
done
|
|
|
|
- name: Upload artifact for checking the output
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
path: ./public
|
|
|
|
- name: Upload artifact for pages
|
|
uses: actions/upload-pages-artifact@v4
|
|
with:
|
|
path: ./public
|
|
|
|
# dev-docs:
|
|
# name: generate the dev doc
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Checkout repository
|
|
# uses: actions/checkout@v4
|
|
# with:
|
|
# repository: uutils/coreutils
|
|
# path: './coreutils'
|
|
# fetch-depth: 0
|
|
|
|
# - name: Install `rust` toolchain
|
|
# uses: actions-rs/toolchain@v1
|
|
# with:
|
|
# toolchain: stable
|
|
# default: true
|
|
# profile: minimal
|
|
|
|
# - name: Build dev documentation
|
|
# run: |
|
|
# cd coreutils
|
|
# cargo doc --no-deps --all-features --workspace
|
|
|
|
# - name: Deploy Docs
|
|
# uses: peaceiris/actions-gh-pages@v3
|
|
# with:
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
# publish_dir: ./coreutils/target/doc
|
|
# destination_dir: coreutils/dev/
|
|
|
|
# build-report:
|
|
# name: generate the build report
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Checkout repository
|
|
# uses: actions/checkout@v4
|
|
# with:
|
|
# repository: uutils/coreutils
|
|
# path: './coreutils'
|
|
# fetch-depth: 0
|
|
|
|
# - name: Install `rust` toolchain
|
|
# uses: actions-rs/toolchain@v1
|
|
# with:
|
|
# toolchain: nightly
|
|
# default: true
|
|
# profile: minimal
|
|
|
|
# - name: Build report
|
|
# run: |
|
|
# cd coreutils
|
|
# cargo +nightly build --timings=html -Zunstable-options
|
|
|
|
# - name: Deploy build report
|
|
# uses: peaceiris/actions-gh-pages@v3
|
|
# with:
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
# publish_dir: ./coreutils/target/cargo-timings/
|
|
# destination_dir: cargo-timings/
|
|
|
|
# Deployment job
|
|
deploy:
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'schedule'
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|