slint/.github/workflows/material.yaml
dependabot[bot] ae51044083
build(deps): bump the github-actions group with 2 updates (#9854)
Bumps the github-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/upload-artifact` from 4 to 5
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

Updates `actions/download-artifact` from 5 to 6
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 13:07:01 +02:00

123 lines
4.2 KiB
YAML

# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
name: Material - Build, test and publish
on:
workflow_dispatch:
inputs:
publish:
type: boolean
description: "Publish master to Cloudflare Pages"
default: false
required: false
workflow_call:
inputs:
publish:
type: boolean
required: false
default: false
description: "Tick the box to publish master to material.slint.dev"
secrets:
CLOUDFLARE_API_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true
ANDROID_KEYSTORE_PASSWORD:
required: true
ANDROID_KEYSTORE_BASE64:
required: true
permissions:
contents: read
jobs:
wasm_demo:
uses: ./.github/workflows/wasm_gallery.yaml
apk_demo:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: ./.github/workflows/apk_gallery.yaml
secrets:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
tests:
env:
CARGO_PROFILE_RELEASE_OPT_LEVEL: s
CARGO_INCREMENTAL: false
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui-libraries/material
steps:
- uses: actions/checkout@v5
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libxkbcommon-x11-dev libfontconfig-dev
shell: bash
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: tests
- name: Build & run tests
run: cargo test -p material-gallery
deploy:
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') || (github.event_name == 'workflow_call' && inputs.publish == true) || github.ref != 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: [wasm_demo, apk_demo]
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
defaults:
run:
working-directory: ui-libraries/material/docs
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libxkbcommon-x11-dev libfontconfig-dev
shell: bash
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: pnpm/action-setup@v4.2.0
with:
version: 10.18.2
- name: Take screenshots
run: cargo run -p slint-docsnapper -- -Lmaterial=$PWD/src/material.slint docs
working-directory: ui-libraries/material
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- uses: actions/download-artifact@v6
with:
name: wasm_gallery
path: ui-libraries/material/docs/dist/wasm
- uses: actions/download-artifact@v6
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
with:
name: apk_gallery
path: ui-libraries/material/docs/dist/apk
- name: prepare zip archive
working-directory: ui-libraries/material
run: |
cp -a src material-1.0
- name: zip up material library
working-directory: ui-libraries/material
run: |
mkdir -p docs/dist/zip
zip -r docs/dist/zip/material-1.0.zip material-1.0
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs/dist --project-name=materialui
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
workingDirectory: ui-libraries/material