From bf0739e06b3cd0f04c760ec68744db6dd1105618 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sun, 25 Aug 2024 10:25:43 +0200 Subject: [PATCH] WIP: try to trigger stm32 builds --- .github/workflows/nightly_snapshot.yaml | 1119 ++++++++++++----------- 1 file changed, 565 insertions(+), 554 deletions(-) diff --git a/.github/workflows/nightly_snapshot.yaml b/.github/workflows/nightly_snapshot.yaml index 398c99f1b2f..0968ac7d690 100644 --- a/.github/workflows/nightly_snapshot.yaml +++ b/.github/workflows/nightly_snapshot.yaml @@ -27,273 +27,273 @@ env: MACOSX_DEPLOYMENT_TARGET: "11.0" jobs: - slint-viewer-binary: - uses: ./.github/workflows/slint_tool_binary.yaml - with: - program: "viewer" - secrets: - certificate: ${{ secrets.APPLE_CERTIFICATE_P12 }} - certificate_password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} - keychain_password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} - developer_id: ${{ secrets.APPLE_DEV_ID }} - slint-lsp-binary: - uses: ./.github/workflows/slint_tool_binary.yaml - with: - program: "lsp" - secrets: - certificate: ${{ secrets.APPLE_CERTIFICATE_P12 }} - certificate_password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} - keychain_password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} - developer_id: ${{ secrets.APPLE_DEV_ID }} - docs: - uses: ./.github/workflows/build_docs.yaml - secrets: inherit - with: - release: ${{ github.event.inputs.release }} - app-id: ${{ vars.READ_WRITE_APP_ID }} - - wasm_demo: - uses: ./.github/workflows/wasm_demos.yaml - with: - rustflags: "--cfg=web_sys_unstable_apis" - build_artifacts: true - wasm: - uses: ./.github/workflows/wasm_editor_and_interpreter.yaml - with: - rustflags: "--cfg=web_sys_unstable_apis" - cpp_package: - uses: ./.github/workflows/cpp_package.yaml - - check-for-secrets: - runs-on: ubuntu-latest - outputs: - has-vscode-marketplace-pat: ${{ steps.one.outputs.has-vscode-marketplace-pat }} - has-openvsx-pat: ${{ steps.one.outputs.has-openvsx-pat }} - steps: - - id: one - run: | - [ -n "${{ secrets.VSCODE_MARKETPLACE_PAT }}" ] && echo "has-vscode-marketplace-pat=yes" >> "$GITHUB_OUTPUT" - [ -n "${{ secrets.OPENVSX_PAT }}" ] && echo "has-openvsx-pat=yes" >> "$GITHUB_OUTPUT" - - build_vscode_lsp_linux_windows: - env: - SLINT_NO_QT: 1 - strategy: - matrix: - include: - - os: ubuntu-20.04 - toolchain: x86_64-unknown-linux-gnu - binary_built: slint-lsp - artifact_name: slint-lsp-x86_64-unknown-linux-gnu - - os: windows-2022 - toolchain: x86_64-pc-windows-msvc - binary_built: slint-lsp.exe - artifact_name: slint-lsp-x86_64-pc-windows-msvc.exe - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-rust - with: - target: ${{ matrix.toolchain }} - - uses: ./.github/actions/install-linux-dependencies - with: - old-ubuntu: true - - name: Build LSP - run: cargo build --target ${{ matrix.toolchain }} --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp - - name: Create artifact directory - run: | - mkdir bin - cp target/${{ matrix.toolchain }}/release/${{ matrix.binary_built }} bin/${{ matrix.artifact_name }} - - name: "Upload LSP Artifact" - uses: actions/upload-artifact@v4 - with: - name: vscode-lsp-binary-${{ matrix.toolchain }} - path: | - bin - - build_vscode_lsp_macos_x86_64: - env: - SLINT_NO_QT: 1 - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-rust - with: - target: x86_64-apple-darwin - - name: Install cargo-bundle - run: cargo install --version=0.6.0 cargo-bundle - - name: Build Main LSP Bundle - working-directory: tools/lsp - run: cargo bundle --release --features ${{ env.SLINT_BINARY_FEATURES }} - - name: Create artifact directory - run: | - mkdir bin - cp -a target/release/bundle/osx/Slint\ Live\ Preview.app bin - - name: "Upload LSP Artifact" - uses: actions/upload-artifact@v4 - with: - name: vscode-lsp-binary-x86_64-apple-darwin - path: | - bin - - build_vscode_lsp_macos_aarch64: - env: - SLINT_NO_QT: 1 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-rust - with: - target: aarch64-apple-darwin - - name: Build AArch64 LSP - run: cargo build --target aarch64-apple-darwin --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp - - name: Create artifact directory - run: | - mkdir bin - cp -a target/aarch64-apple-darwin/release/slint-lsp bin/slint-lsp-aarch64-apple-darwin - - name: "Upload LSP Artifact" - uses: actions/upload-artifact@v4 - with: - name: vscode-lsp-binary-aarch64-apple-darwin - path: | - bin - - build_vscode_lsp_macos_bundle: - needs: [build_vscode_lsp_macos_x86_64, build_vscode_lsp_macos_aarch64] - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - path: "src" - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-x86_64-apple-darwin - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-aarch64-apple-darwin - path: bin - - name: Add macOS AArch64 binary to bundle - run: | - lipo -create -output tmp Slint\ Live\ Preview.app/Contents/MacOS/slint-lsp bin/slint-lsp-aarch64-apple-darwin - mv tmp Slint\ Live\ Preview.app/Contents/MacOS/slint-lsp - rm -rf bin - - uses: ./src/.github/actions/codesign - with: - binary: "Slint Live Preview.app" - certificate: ${{ secrets.APPLE_CERTIFICATE_P12 }} - certificate_password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} - keychain_password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} - developer_id: ${{ secrets.APPLE_DEV_ID }} - - name: "Remove temporary source checkout" - run: rm -rf src - - name: "Upload LSP macOS bundle Artifact" - uses: actions/upload-artifact@v4 - with: - name: vscode-lsp-binary-darwin - path: . - - build_vscode_cross_linux_lsp: - env: - SLINT_NO_QT: 1 - strategy: - matrix: - target: - - armv7-unknown-linux-gnueabihf - - aarch64-unknown-linux-gnu - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-rust - with: - target: ${{ matrix.target }} - - uses: baptiste0928/cargo-install@v3 - with: - crate: cross - - name: Build LSP - run: cross build --target ${{ matrix.target }} --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp - - name: Create artifact directory - run: | - mkdir bin - cp target/${{ matrix.target }}/release/slint-lsp bin/slint-lsp-${{ matrix.target }} - - name: "Upload LSP Artifact" - uses: actions/upload-artifact@v4 - with: - name: vscode-lsp-binary-${{ matrix.target }} - path: | - bin - - build_vscode_extension: - needs: - [ - build_vscode_lsp_linux_windows, - build_vscode_lsp_macos_bundle, - build_vscode_cross_linux_lsp, - check-for-secrets, - ] - runs-on: macos-12 - if: ${{ needs.check-for-secrets.outputs.has-openvsx-pat == 'yes' && needs.check-for-secrets.outputs.has-vscode-marketplace-pat == 'yes' }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-x86_64-unknown-linux-gnu - path: editors/vscode/bin - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-x86_64-pc-windows-msvc - path: editors/vscode/bin - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-darwin - path: editors/vscode/bin - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-armv7-unknown-linux-gnueabihf - path: editors/vscode/bin - - uses: actions/download-artifact@v4 - with: - name: vscode-lsp-binary-aarch64-unknown-linux-gnu - path: editors/vscode/bin - - name: Fix permissions - run: chmod 755 editors/vscode/bin/* editors/vscode/bin/*.app/Contents/MacOS/* - - name: "Prepare meta-data files for nightly package" - env: - RELEASE_INPUT: ${{ github.event.inputs.release }} - working-directory: editors/vscode - run: | - if [ "$RELEASE_INPUT" != "true" ]; then - ../../scripts/prepare_vscode_nightly.sh - fi - - name: "npm install" - working-directory: editors/vscode - run: npm install - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Build package and optionally publish to Visual Studio Marketplace - id: publishToVSCM - uses: HaaLeo/publish-vscode-extension@v1 - with: - pat: ${{ secrets.VSCODE_MARKETPLACE_PAT }} - registryUrl: https://marketplace.visualstudio.com - dryRun: ${{ github.event.inputs.private == 'true' || (github.ref != 'refs/heads/master' && github.event.inputs.release != 'true') }} - packagePath: editors/vscode - - name: Publish to Open VSX Registry - continue-on-error: true - if: ${{ github.event.inputs.private != 'true' && (github.ref == 'refs/heads/master' || github.event.inputs.release == 'true') }} - uses: HaaLeo/publish-vscode-extension@v1 - with: - pat: ${{ secrets.OPENVSX_PAT }} - extensionFile: ${{ steps.publishToVSCM.outputs.vsixPath }} - packagePath: "" - - name: "Upload extension artifact" - uses: actions/upload-artifact@v4 - with: - name: slint-vscode.zip - path: | - ${{ steps.publishToVSCM.outputs.vsixPath }} + # slint-viewer-binary: + # uses: ./.github/workflows/slint_tool_binary.yaml + # with: + # program: "viewer" + # secrets: + # certificate: ${{ secrets.APPLE_CERTIFICATE_P12 }} + # certificate_password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} + # keychain_password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} + # developer_id: ${{ secrets.APPLE_DEV_ID }} + # slint-lsp-binary: + # uses: ./.github/workflows/slint_tool_binary.yaml + # with: + # program: "lsp" + # secrets: + # certificate: ${{ secrets.APPLE_CERTIFICATE_P12 }} + # certificate_password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} + # keychain_password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} + # developer_id: ${{ secrets.APPLE_DEV_ID }} + # docs: + # uses: ./.github/workflows/build_docs.yaml + # secrets: inherit + # with: + # release: ${{ github.event.inputs.release }} + # app-id: ${{ vars.READ_WRITE_APP_ID }} + + # wasm_demo: + # uses: ./.github/workflows/wasm_demos.yaml + # with: + # rustflags: "--cfg=web_sys_unstable_apis" + # build_artifacts: true + # wasm: + # uses: ./.github/workflows/wasm_editor_and_interpreter.yaml + # with: + # rustflags: "--cfg=web_sys_unstable_apis" + # cpp_package: + # uses: ./.github/workflows/cpp_package.yaml + + # check-for-secrets: + # runs-on: ubuntu-latest + # outputs: + # has-vscode-marketplace-pat: ${{ steps.one.outputs.has-vscode-marketplace-pat }} + # has-openvsx-pat: ${{ steps.one.outputs.has-openvsx-pat }} + # steps: + # - id: one + # run: | + # [ -n "${{ secrets.VSCODE_MARKETPLACE_PAT }}" ] && echo "has-vscode-marketplace-pat=yes" >> "$GITHUB_OUTPUT" + # [ -n "${{ secrets.OPENVSX_PAT }}" ] && echo "has-openvsx-pat=yes" >> "$GITHUB_OUTPUT" + + # build_vscode_lsp_linux_windows: + # env: + # SLINT_NO_QT: 1 + # strategy: + # matrix: + # include: + # - os: ubuntu-20.04 + # toolchain: x86_64-unknown-linux-gnu + # binary_built: slint-lsp + # artifact_name: slint-lsp-x86_64-unknown-linux-gnu + # - os: windows-2022 + # toolchain: x86_64-pc-windows-msvc + # binary_built: slint-lsp.exe + # artifact_name: slint-lsp-x86_64-pc-windows-msvc.exe + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v4 + # - uses: ./.github/actions/setup-rust + # with: + # target: ${{ matrix.toolchain }} + # - uses: ./.github/actions/install-linux-dependencies + # with: + # old-ubuntu: true + # - name: Build LSP + # run: cargo build --target ${{ matrix.toolchain }} --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp + # - name: Create artifact directory + # run: | + # mkdir bin + # cp target/${{ matrix.toolchain }}/release/${{ matrix.binary_built }} bin/${{ matrix.artifact_name }} + # - name: "Upload LSP Artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: vscode-lsp-binary-${{ matrix.toolchain }} + # path: | + # bin + + # build_vscode_lsp_macos_x86_64: + # env: + # SLINT_NO_QT: 1 + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v4 + # - uses: ./.github/actions/setup-rust + # with: + # target: x86_64-apple-darwin + # - name: Install cargo-bundle + # run: cargo install --version=0.6.0 cargo-bundle + # - name: Build Main LSP Bundle + # working-directory: tools/lsp + # run: cargo bundle --release --features ${{ env.SLINT_BINARY_FEATURES }} + # - name: Create artifact directory + # run: | + # mkdir bin + # cp -a target/release/bundle/osx/Slint\ Live\ Preview.app bin + # - name: "Upload LSP Artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: vscode-lsp-binary-x86_64-apple-darwin + # path: | + # bin + + # build_vscode_lsp_macos_aarch64: + # env: + # SLINT_NO_QT: 1 + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: ./.github/actions/setup-rust + # with: + # target: aarch64-apple-darwin + # - name: Build AArch64 LSP + # run: cargo build --target aarch64-apple-darwin --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp + # - name: Create artifact directory + # run: | + # mkdir bin + # cp -a target/aarch64-apple-darwin/release/slint-lsp bin/slint-lsp-aarch64-apple-darwin + # - name: "Upload LSP Artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: vscode-lsp-binary-aarch64-apple-darwin + # path: | + # bin + + # build_vscode_lsp_macos_bundle: + # needs: [build_vscode_lsp_macos_x86_64, build_vscode_lsp_macos_aarch64] + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v4 + # with: + # path: "src" + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-x86_64-apple-darwin + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-aarch64-apple-darwin + # path: bin + # - name: Add macOS AArch64 binary to bundle + # run: | + # lipo -create -output tmp Slint\ Live\ Preview.app/Contents/MacOS/slint-lsp bin/slint-lsp-aarch64-apple-darwin + # mv tmp Slint\ Live\ Preview.app/Contents/MacOS/slint-lsp + # rm -rf bin + # - uses: ./src/.github/actions/codesign + # with: + # binary: "Slint Live Preview.app" + # certificate: ${{ secrets.APPLE_CERTIFICATE_P12 }} + # certificate_password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} + # keychain_password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} + # developer_id: ${{ secrets.APPLE_DEV_ID }} + # - name: "Remove temporary source checkout" + # run: rm -rf src + # - name: "Upload LSP macOS bundle Artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: vscode-lsp-binary-darwin + # path: . + + # build_vscode_cross_linux_lsp: + # env: + # SLINT_NO_QT: 1 + # strategy: + # matrix: + # target: + # - armv7-unknown-linux-gnueabihf + # - aarch64-unknown-linux-gnu + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v4 + # - uses: ./.github/actions/setup-rust + # with: + # target: ${{ matrix.target }} + # - uses: baptiste0928/cargo-install@v3 + # with: + # crate: cross + # - name: Build LSP + # run: cross build --target ${{ matrix.target }} --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp + # - name: Create artifact directory + # run: | + # mkdir bin + # cp target/${{ matrix.target }}/release/slint-lsp bin/slint-lsp-${{ matrix.target }} + # - name: "Upload LSP Artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: vscode-lsp-binary-${{ matrix.target }} + # path: | + # bin + + # build_vscode_extension: + # needs: + # [ + # build_vscode_lsp_linux_windows, + # build_vscode_lsp_macos_bundle, + # build_vscode_cross_linux_lsp, + # check-for-secrets, + # ] + # runs-on: macos-12 + # if: ${{ needs.check-for-secrets.outputs.has-openvsx-pat == 'yes' && needs.check-for-secrets.outputs.has-vscode-marketplace-pat == 'yes' }} + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-node@v4 + # with: + # node-version: 18 + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-x86_64-unknown-linux-gnu + # path: editors/vscode/bin + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-x86_64-pc-windows-msvc + # path: editors/vscode/bin + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-darwin + # path: editors/vscode/bin + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-armv7-unknown-linux-gnueabihf + # path: editors/vscode/bin + # - uses: actions/download-artifact@v4 + # with: + # name: vscode-lsp-binary-aarch64-unknown-linux-gnu + # path: editors/vscode/bin + # - name: Fix permissions + # run: chmod 755 editors/vscode/bin/* editors/vscode/bin/*.app/Contents/MacOS/* + # - name: "Prepare meta-data files for nightly package" + # env: + # RELEASE_INPUT: ${{ github.event.inputs.release }} + # working-directory: editors/vscode + # run: | + # if [ "$RELEASE_INPUT" != "true" ]; then + # ../../scripts/prepare_vscode_nightly.sh + # fi + # - name: "npm install" + # working-directory: editors/vscode + # run: npm install + # - name: Install wasm-pack + # run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + # - name: Build package and optionally publish to Visual Studio Marketplace + # id: publishToVSCM + # uses: HaaLeo/publish-vscode-extension@v1 + # with: + # pat: ${{ secrets.VSCODE_MARKETPLACE_PAT }} + # registryUrl: https://marketplace.visualstudio.com + # dryRun: ${{ github.event.inputs.private == 'true' || (github.ref != 'refs/heads/master' && github.event.inputs.release != 'true') }} + # packagePath: editors/vscode + # - name: Publish to Open VSX Registry + # continue-on-error: true + # if: ${{ github.event.inputs.private != 'true' && (github.ref == 'refs/heads/master' || github.event.inputs.release == 'true') }} + # uses: HaaLeo/publish-vscode-extension@v1 + # with: + # pat: ${{ secrets.OPENVSX_PAT }} + # extensionFile: ${{ steps.publishToVSCM.outputs.vsixPath }} + # packagePath: "" + # - name: "Upload extension artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: slint-vscode.zip + # path: | + # ${{ steps.publishToVSCM.outputs.vsixPath }} # publish_tree_sitter: # if: github.event.inputs.private != 'true' @@ -306,297 +306,308 @@ jobs: # name: tree-sitter-slint # path: editors/tree-sitter-slint - publish_artifacts: - if: ${{ github.event.inputs.private != 'true' }} - needs: [docs, wasm_demo, wasm, check-for-secrets] - runs-on: ubuntu-20.04 - steps: - - uses: actions/download-artifact@v4 - with: - name: docs - - uses: actions/download-artifact@v4 - with: - name: slintpad - path: slintpad - - uses: actions/download-artifact@v4 - with: - name: wasm - - uses: actions/download-artifact@v4 - with: - name: wasm_demo - - uses: actions/download-artifact@v4 - with: - name: android-demo - path: android - - - name: Extract Version - id: version - run: | - version=$(grep -oP '(?<=Slint )[0-9]+\.[0-9]+\.[0-9]+' target/slintdocs/html/index.html) - if [[ -z "$version" ]]; then - echo "Version not found" - exit 1 - fi - echo "VERSION=$version" >> $GITHUB_OUTPUT - - - 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 directory - uses: actions/checkout@v4 - with: - repository: slint-ui/www-releases - path: www-releases - token: ${{ steps.app-token.outputs.token }} - - - name: Publish Docs and Demos - working-directory: ./www-releases - run: | - if [[ "${{ github.event.inputs.release }}" == "true" ]]; then - output_path="releases/${{ steps.version.outputs.VERSION }}" - else - output_path="snapshots/${GITHUB_REF##*/}" - fi - - rm -rf $output_path/demos - mkdir -p $output_path/demos - - for demo_subdir in gallery, printerdemo,rust printerdemo_old,rust todo,rust todo-mvc,rust slide_puzzle, memory, imagefilter,rust plotter, opengl_underlay, carousel,rust energy-monitor, weather-demo,; do - IFS=',' read demo subdir <<< "${demo_subdir}" - - mkdir -p $output_path/demos/$demo - cp -a ../$demo/$subdir/{pkg,index.html} $output_path/demos/$demo/ - done - - mkdir -p $output_path/demos/android - cp -a ../android/* $output_path/demos/android/ - - rm -rf $output_path/wasm-interpreter - mkdir -p $output_path/wasm-interpreter - cp -a ../api/wasm-interpreter/pkg/* ./$output_path/wasm-interpreter/ - - rm -rf $output_path/editor - mkdir -p $output_path/editor - cp -a ../slintpad/* $output_path/editor/ - - if [[ "${{ github.event.inputs.release }}" == "true" ]]; then - version="${{ steps.version.outputs.VERSION }}" - else - version="development snapshot" - fi - sed -i 's/VERSION/$version/g' ../docs/site/index.html - - rm -rf $output_path/docs - mkdir -p $output_path/docs - cp -a ../docs/site/* $output_path/docs - mkdir -p $output_path/docs/cpp - cp -a ../target/cppdocs/html/* $output_path/docs/cpp/ - mkdir -p $output_path/docs/rust - cp -a ../target/doc/* $output_path/docs/rust/ - - # Fix up link to Slint language documentation - sed -i "s!https://slint.dev/releases/.*/docs/!../../!" $output_path/docs/rust/slint/*.html - - mkdir -p $output_path/docs/node - cp -a ../api/node/docs/* $output_path/docs/node/ - mkdir -p $output_path/docs/slint - cp -a ../target/slintdocs/html/* $output_path/docs/slint/ - - - name: Adjust redirections - if: github.event.inputs.release == 'true' - run: | - sed -i "/1.0.2/! s,[0-9]*\.[0-9]*\.[0-9]*/\(.*\),${{ steps.version.outputs.VERSION }}/\1," www-releases/releases/_redirects - - - name: Adjust slintpad default tag - if: github.event.inputs.release == 'true' - run: sed -i "s,XXXX_DEFAULT_TAG_XXXX,v${{ steps.version.outputs.VERSION }}," www-releases/releases/${{ steps.version.outputs.VERSION }}/editor/assets/*.js - - - name: Update versions.txt - if: github.event.inputs.release == 'true' - working-directory: www-releases/releases - run: ls -1d */ | cut -f1 -d'/' | sort --version-sort -r > versions.txt - - - name: Update SlintPad - if: github.event.inputs.release == 'true' - run: | - rm -rf www-releases/slintpad - cp -r www-releases/releases/${{ steps.version.outputs.VERSION }}/editor www-releases/slintpad - for f in 404.html script.js LICENSE.md package.json; do - cp www-releases/releases/$f www-releases/slintpad - done - echo "${{ steps.version.outputs.VERSION }}" > www-releases/slintpad/versions.txt - - - 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 - if: ${{ steps.www-releases.outputs.has-diff == 'yes' }} - 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 "Pull web demos and C++/Rust reference docs from commit $GITHUB_SHA ($GITHUB_REF)" - git push + # publish_artifacts: + # if: ${{ github.event.inputs.private != 'true' }} + # needs: [docs, wasm_demo, wasm, check-for-secrets] + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/download-artifact@v4 + # with: + # name: docs + # - uses: actions/download-artifact@v4 + # with: + # name: slintpad + # path: slintpad + # - uses: actions/download-artifact@v4 + # with: + # name: wasm + # - uses: actions/download-artifact@v4 + # with: + # name: wasm_demo + # - uses: actions/download-artifact@v4 + # with: + # name: android-demo + # path: android + + # - name: Extract Version + # id: version + # run: | + # version=$(grep -oP '(?<=<title>Slint )[0-9]+\.[0-9]+\.[0-9]+' target/slintdocs/html/index.html) + # if [[ -z "$version" ]]; then + # echo "Version not found" + # exit 1 + # fi + # echo "VERSION=$version" >> $GITHUB_OUTPUT + + # - 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 directory + # uses: actions/checkout@v4 + # with: + # repository: slint-ui/www-releases + # path: www-releases + # token: ${{ steps.app-token.outputs.token }} + + # - name: Publish Docs and Demos + # working-directory: ./www-releases + # run: | + # if [[ "${{ github.event.inputs.release }}" == "true" ]]; then + # output_path="releases/${{ steps.version.outputs.VERSION }}" + # else + # output_path="snapshots/${GITHUB_REF##*/}" + # fi + + # rm -rf $output_path/demos + # mkdir -p $output_path/demos + + # for demo_subdir in gallery, printerdemo,rust printerdemo_old,rust todo,rust todo-mvc,rust slide_puzzle, memory, imagefilter,rust plotter, opengl_underlay, carousel,rust energy-monitor, weather-demo,; do + # IFS=',' read demo subdir <<< "${demo_subdir}" + + # mkdir -p $output_path/demos/$demo + # cp -a ../$demo/$subdir/{pkg,index.html} $output_path/demos/$demo/ + # done + + # mkdir -p $output_path/demos/android + # cp -a ../android/* $output_path/demos/android/ + + # rm -rf $output_path/wasm-interpreter + # mkdir -p $output_path/wasm-interpreter + # cp -a ../api/wasm-interpreter/pkg/* ./$output_path/wasm-interpreter/ + + # rm -rf $output_path/editor + # mkdir -p $output_path/editor + # cp -a ../slintpad/* $output_path/editor/ + + # if [[ "${{ github.event.inputs.release }}" == "true" ]]; then + # version="${{ steps.version.outputs.VERSION }}" + # else + # version="development snapshot" + # fi + # sed -i 's/VERSION/$version/g' ../docs/site/index.html + + # rm -rf $output_path/docs + # mkdir -p $output_path/docs + # cp -a ../docs/site/* $output_path/docs + # mkdir -p $output_path/docs/cpp + # cp -a ../target/cppdocs/html/* $output_path/docs/cpp/ + # mkdir -p $output_path/docs/rust + # cp -a ../target/doc/* $output_path/docs/rust/ + + # # Fix up link to Slint language documentation + # sed -i "s!https://slint.dev/releases/.*/docs/!../../!" $output_path/docs/rust/slint/*.html + + # mkdir -p $output_path/docs/node + # cp -a ../api/node/docs/* $output_path/docs/node/ + # mkdir -p $output_path/docs/slint + # cp -a ../target/slintdocs/html/* $output_path/docs/slint/ + + # - name: Adjust redirections + # if: github.event.inputs.release == 'true' + # run: | + # sed -i "/1.0.2/! s,[0-9]*\.[0-9]*\.[0-9]*/\(.*\),${{ steps.version.outputs.VERSION }}/\1," www-releases/releases/_redirects + + # - name: Adjust slintpad default tag + # if: github.event.inputs.release == 'true' + # run: sed -i "s,XXXX_DEFAULT_TAG_XXXX,v${{ steps.version.outputs.VERSION }}," www-releases/releases/${{ steps.version.outputs.VERSION }}/editor/assets/*.js + + # - name: Update versions.txt + # if: github.event.inputs.release == 'true' + # working-directory: www-releases/releases + # run: ls -1d */ | cut -f1 -d'/' | sort --version-sort -r > versions.txt + + # - name: Update SlintPad + # if: github.event.inputs.release == 'true' + # run: | + # rm -rf www-releases/slintpad + # cp -r www-releases/releases/${{ steps.version.outputs.VERSION }}/editor www-releases/slintpad + # for f in 404.html script.js LICENSE.md package.json; do + # cp www-releases/releases/$f www-releases/slintpad + # done + # echo "${{ steps.version.outputs.VERSION }}" > www-releases/slintpad/versions.txt + + # - 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 + # if: ${{ steps.www-releases.outputs.has-diff == 'yes' }} + # 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 "Pull web demos and C++/Rust reference docs from commit $GITHUB_SHA ($GITHUB_REF)" + # git push prepare_release: if: github.event.inputs.private != 'true' - needs: [cpp_package, slint-viewer-binary, slint-lsp-binary] + #needs: [cpp_package, slint-viewer-binary, slint-lsp-binary] runs-on: ubuntu-22.04 permissions: contents: write + actions: write steps: - - uses: actions/download-artifact@v4 - with: - pattern: cpp_bin-* - merge-multiple: true - - uses: actions/download-artifact@v4 - with: - pattern: cpp_mcu_bin-* - merge-multiple: true - - uses: actions/download-artifact@v4 - with: - pattern: slint-viewer-* - merge-multiple: true - - uses: actions/download-artifact@v4 - with: - pattern: slint-lsp-* - merge-multiple: true - - name: Extract files - run: | - ls -l - mkdir artifacts - mv Slint-cpp-*-win64*.exe artifacts/ - mv Slint-cpp-*.tar.gz artifacts/ - mv slint-viewer-linux.tar.gz artifacts/ - mv slint-viewer-armv7-unknown-linux-gnueabihf.tar.gz artifacts/ - mv slint-viewer-aarch64-unknown-linux-gnu.tar.gz artifacts/ - mv slint-viewer-macos.tar.gz artifacts/ - mv slint-lsp-linux.tar.gz artifacts/ - mv slint-lsp-armv7-unknown-linux-gnueabihf.tar.gz artifacts/ - mv slint-lsp-aarch64-unknown-linux-gnu.tar.gz artifacts/ - mv slint-lsp-macos.tar.gz artifacts/ - - name: Extract Version - id: version - run: | - version=$(echo artifacts/Slint-cpp-*-win64-MSVC.exe | sed -nre 's/^.*-([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p') - if [[ -z "$version" ]]; then - echo "Version not found" - exit 1 - fi - echo "VERSION=$version" >> $GITHUB_OUTPUT - major=`echo $version | sed -e "s,\([0-9]*\)\.[0-9]*\.[0-9]*,\1,"` - echo "MAJOR_VERSION=$major" >> $GITHUB_OUTPUT - minor=`echo $version | sed -e "s,[0-9]*\.\([0-9]*\)\.[0-9]*,\1,"` - echo "MINOR_VERSION=$minor" >> $GITHUB_OUTPUT - - uses: montudor/action-zip@v1 - with: - args: zip -r artifacts/slint-viewer-windows.zip slint-viewer - - uses: montudor/action-zip@v1 - with: - args: zip -r artifacts/slint-lsp-windows.zip slint-lsp - - uses: actions/checkout@v4 - with: - path: "slint-src" - sparse-checkout: docs - - name: prepare release notes - env: - RELEASE_INPUT: ${{ github.event.inputs.release }} - run: | - if [ "$RELEASE_INPUT" != "true" ]; then - notes_file=slint-src/docs/_templates/nightly-release-notes.md - else - notes_file=slint-src/docs/_templates/release-notes.md - fi - cat $notes_file slint-src/docs/_templates/release-artifacts.md > release-notes.md - sed -i -e "s,{version},${{ steps.version.outputs.VERSION}},g" release-notes.md - sed -i -e "s,{major_version},${{ steps.version.outputs.MAJOR_VERSION}},g" release-notes.md - sed -i -e "s,{minor_version},${{ steps.version.outputs.MINOR_VERSION}},g" release-notes.md - if [ "$RELEASE_INPUT" != "true" ]; then - sed -i -e "s,{download_version},nightly,g" release-notes.md - else - sed -i -e "s,{download_version},${{ steps.version.outputs.VERSION}},g" release-notes.md - fi - cat release-notes.md - - uses: ncipollo/release-action@v1 - if: github.event.inputs.release == 'true' - with: - draft: true - artifacts: "artifacts/*" - bodyFile: release-notes.md - name: ${{ steps.version.outputs.VERSION }} - tag: v${{ steps.version.outputs.VERSION }} - commit: ${{ github.sha }} - - uses: ncipollo/release-action@v1 - if: github.event.inputs.release != 'true' - with: - allowUpdates: true - prerelease: true - removeArtifacts: true - replacesArtifacts: true - artifacts: "artifacts/*" - bodyFile: release-notes.md - name: nightly - tag: nightly - commit: 7742f833803020023364c0ec801648fb93f4793b - - android: - env: - CARGO_APK_RELEASE_KEYSTORE: /home/runner/.android/release.keystore - CARGO_APK_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Android API level 30 - run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-30" - - name: Cache cargo-apk - id: cargo-apk-cache - uses: actions/cache@v4 - with: - path: ~/.cargo/bin/cargo-apk - key: cargo-apk-cache - # Only build cargo-apk if not cached - - uses: dtolnay/rust-toolchain@stable - if: steps.cargo-apk-cache.outputs.cache-hit != 'true' - - name: Install cargo-apk - if: steps.cargo-apk-cache.outputs.cache-hit != 'true' - run: cargo install cargo-apk - - - uses: ./.github/actions/setup-rust - with: - target: aarch64-linux-android - - - name: dump keystore - run: | - mkdir -p /home/runner/.android - echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > $CARGO_APK_RELEASE_KEYSTORE - - - name: Build energy-monitor example - run: cargo apk build -p energy-monitor --target aarch64-linux-android --lib --release - - name: Build todo demo - run: cargo apk build -p todo --target aarch64-linux-android --lib --release - - name: Build weather-demo example - run: cargo apk build -p weather-demo --target aarch64-linux-android --lib --release - - name: "upload APK artifact" - uses: actions/upload-artifact@v4 - with: - name: android-demo - path: | - target/release/apk/energy-monitor.apk - target/release/apk/todo_lib.apk - target/release/apk/weather_demo.apk + - name: trigger stm32 build + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/slint-ui/slint-cpp-templates-stm32/actions/workflows/ci.yaml/dispatches \ + -d '{"ref":"main"}' + + # - uses: actions/download-artifact@v4 + # with: + # pattern: cpp_bin-* + # merge-multiple: true + # - uses: actions/download-artifact@v4 + # with: + # pattern: cpp_mcu_bin-* + # merge-multiple: true + # - uses: actions/download-artifact@v4 + # with: + # pattern: slint-viewer-* + # merge-multiple: true + # - uses: actions/download-artifact@v4 + # with: + # pattern: slint-lsp-* + # merge-multiple: true + # - name: Extract files + # run: | + # ls -l + # mkdir artifacts + # mv Slint-cpp-*-win64*.exe artifacts/ + # mv Slint-cpp-*.tar.gz artifacts/ + # mv slint-viewer-linux.tar.gz artifacts/ + # mv slint-viewer-armv7-unknown-linux-gnueabihf.tar.gz artifacts/ + # mv slint-viewer-aarch64-unknown-linux-gnu.tar.gz artifacts/ + # mv slint-viewer-macos.tar.gz artifacts/ + # mv slint-lsp-linux.tar.gz artifacts/ + # mv slint-lsp-armv7-unknown-linux-gnueabihf.tar.gz artifacts/ + # mv slint-lsp-aarch64-unknown-linux-gnu.tar.gz artifacts/ + # mv slint-lsp-macos.tar.gz artifacts/ + # - name: Extract Version + # id: version + # run: | + # version=$(echo artifacts/Slint-cpp-*-win64-MSVC.exe | sed -nre 's/^.*-([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p') + # if [[ -z "$version" ]]; then + # echo "Version not found" + # exit 1 + # fi + # echo "VERSION=$version" >> $GITHUB_OUTPUT + # major=`echo $version | sed -e "s,\([0-9]*\)\.[0-9]*\.[0-9]*,\1,"` + # echo "MAJOR_VERSION=$major" >> $GITHUB_OUTPUT + # minor=`echo $version | sed -e "s,[0-9]*\.\([0-9]*\)\.[0-9]*,\1,"` + # echo "MINOR_VERSION=$minor" >> $GITHUB_OUTPUT + # - uses: montudor/action-zip@v1 + # with: + # args: zip -r artifacts/slint-viewer-windows.zip slint-viewer + # - uses: montudor/action-zip@v1 + # with: + # args: zip -r artifacts/slint-lsp-windows.zip slint-lsp + # - uses: actions/checkout@v4 + # with: + # path: "slint-src" + # sparse-checkout: docs + # - name: prepare release notes + # env: + # RELEASE_INPUT: ${{ github.event.inputs.release }} + # run: | + # if [ "$RELEASE_INPUT" != "true" ]; then + # notes_file=slint-src/docs/_templates/nightly-release-notes.md + # else + # notes_file=slint-src/docs/_templates/release-notes.md + # fi + # cat $notes_file slint-src/docs/_templates/release-artifacts.md > release-notes.md + # sed -i -e "s,{version},${{ steps.version.outputs.VERSION}},g" release-notes.md + # sed -i -e "s,{major_version},${{ steps.version.outputs.MAJOR_VERSION}},g" release-notes.md + # sed -i -e "s,{minor_version},${{ steps.version.outputs.MINOR_VERSION}},g" release-notes.md + # if [ "$RELEASE_INPUT" != "true" ]; then + # sed -i -e "s,{download_version},nightly,g" release-notes.md + # else + # sed -i -e "s,{download_version},${{ steps.version.outputs.VERSION}},g" release-notes.md + # fi + # cat release-notes.md + # - uses: ncipollo/release-action@v1 + # if: github.event.inputs.release == 'true' + # with: + # draft: true + # artifacts: "artifacts/*" + # bodyFile: release-notes.md + # name: ${{ steps.version.outputs.VERSION }} + # tag: v${{ steps.version.outputs.VERSION }} + # commit: ${{ github.sha }} + # - uses: ncipollo/release-action@v1 + # if: github.event.inputs.release != 'true' + # with: + # allowUpdates: true + # prerelease: true + # removeArtifacts: true + # replacesArtifacts: true + # artifacts: "artifacts/*" + # bodyFile: release-notes.md + # name: nightly + # tag: nightly + # commit: 7742f833803020023364c0ec801648fb93f4793b + + # android: + # env: + # CARGO_APK_RELEASE_KEYSTORE: /home/runner/.android/release.keystore + # CARGO_APK_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install Android API level 30 + # run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-30" + # - name: Cache cargo-apk + # id: cargo-apk-cache + # uses: actions/cache@v4 + # with: + # path: ~/.cargo/bin/cargo-apk + # key: cargo-apk-cache + # # Only build cargo-apk if not cached + # - uses: dtolnay/rust-toolchain@stable + # if: steps.cargo-apk-cache.outputs.cache-hit != 'true' + # - name: Install cargo-apk + # if: steps.cargo-apk-cache.outputs.cache-hit != 'true' + # run: cargo install cargo-apk + + # - uses: ./.github/actions/setup-rust + # with: + # target: aarch64-linux-android + + # - name: dump keystore + # run: | + # mkdir -p /home/runner/.android + # echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > $CARGO_APK_RELEASE_KEYSTORE + + # - name: Build energy-monitor example + # run: cargo apk build -p energy-monitor --target aarch64-linux-android --lib --release + # - name: Build todo demo + # run: cargo apk build -p todo --target aarch64-linux-android --lib --release + # - name: Build weather-demo example + # run: cargo apk build -p weather-demo --target aarch64-linux-android --lib --release + # - name: "upload APK artifact" + # uses: actions/upload-artifact@v4 + # with: + # name: android-demo + # path: | + # target/release/apk/energy-monitor.apk + # target/release/apk/todo_lib.apk + # target/release/apk/weather_demo.apk