Skip to content

Next gen docs for 1.9 #114

Next gen docs for 1.9

Next gen docs for 1.9 #114

Workflow file for this run

# Copyright © SixtyFPS GmbH <[email protected]>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
name: Build New Docs
on:
push:
branches: ["docs-tng"]
pull_request:
branches: [master, "feature/*"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
docs:
runs-on: macos-14
env:
# Allow deprecated warning because we are using nightly and some things might be deprecated in nightly
# for which the stable alternative is not yet available.
RUSTFLAGS: -D warnings -W deprecated
RUSTDOCFLAGS: --html-in-header=/home/runner/work/slint/slint/docs/resources/slint-docs-highlight.html -D warnings -W deprecated
SLINT_NO_QT: 1
CARGO_INCREMENTAL: false
RELEASE_INPUT: ${{ inputs.release }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/[email protected]
with:
version: 9.11.0
- uses: ./.github/actions/setup-rust
with:
toolchain: nightly
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# - uses: ./.github/actions/install-linux-dependencies
# with:
# extra-packages: libfontconfig-dev fonts-open-sans ttf-mscorefonts-installer
# - name: Check license headers
# run: cargo xtask check_license_headers --fix-it
# - name: Suggest license header changes
# uses: reviewdog/action-suggester@v1
# with:
# tool_name: xtask license_header
# level: error
# fail_on_error: true
# - run: sudo apt-get install reuse
# - name: Check reuse compliance
# run: cargo xtask check_reuse_compliance
# Generate screenshots
#
# Note: This is not part of the xtask to avoid the xtask depending on all of slint!
- name: Generate screenshots
run: cargo run -p slint-docsnapper -- docs/src/content
# Build Docs
- name: Run slintdocs xtask
run: cargo xtask slintdocs
# Test docs
- name: Run Playwright tests
run: cd docs && pnpm exec playwright test
- name: Publish Test Summary Results
run: cd docs && npx github-actions-ctrf playwright-report/ctrf-report.json
- name: Check spelling
run: cd docs && pnpm spellcheck
# Commit to www-releases/snapshots/tng
- name: Generate a token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.READ_WRITE_APP_ID }}
private-key: ${{ secrets.READ_WRITE_PRIVATE_KEY }}
repositories: www-releases
- name: Clone www-releases/snapshots directory
uses: actions/checkout@v4
with:
repository: slint-ui/www-releases
path: www-releases
token: ${{ steps.app-token.outputs.token }}
sparse-checkout: |
snapshots/tng
- name: copy docs to www-releases
run: |
rm -rf www-releases/snapshots/tng
mkdir -p www-releases/snapshots/tng
cp -a docs/dist/* www-releases/snapshots/tng
ls -l www-releases/snapshots/tng/
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: check for diff
id: www-releases
working-directory: ./www-releases
run: |
git diff-index --quiet HEAD || echo "has-diff=yes" >> "$GITHUB_OUTPUT"
- name: commit and push
working-directory: ./www-releases
run: |
git config user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
git add .
git add -u .
git commit --message "Update $NAME from $GITHUB_REPOSITORY" --message "Update tng docs from commit $GITHUB_SHA ($GITHUB_REF)"
git push