Wait for a composed character before the desktop question box asks (#… #88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Desktop | |
| # The shell is the one thing here that cannot be proved by running it on Linux: it is a macOS app, a | |
| # Windows app and a Linux app built from one tree, and the ways they differ are exactly the ways | |
| # this fails. So it tests and builds on all three, on every change to it. | |
| on: | |
| pull_request: | |
| paths: ["desktop/**", ".github/workflows/desktop.yml"] | |
| push: | |
| branches: [main] | |
| paths: ["desktop/**", ".github/workflows/desktop.yml"] | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: desktop-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| # Fast formatting and lint checks. Rust regression tests run once per platform below. | |
| core: | |
| name: core | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| workspaces: desktop/src-tauri | |
| # Linux is the only target needing system libraries, and it needs them even to check. | |
| - run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - run: cargo fmt --check | |
| working-directory: desktop/src-tauri | |
| - run: cargo clippy --all-targets -- -D warnings | |
| working-directory: desktop/src-tauri | |
| # The three artifacts. Not `bundle`, which signs and notarizes: that is S7 and needs certificates | |
| # this workflow deliberately does not hold. This proves the tree builds into an app on each | |
| # platform, which is the thing that breaks when a dependency is not portable. | |
| app: | |
| name: app (${{ matrix.platform.name }}) | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - name: macos | |
| runner: macos-latest | |
| - name: windows | |
| runner: windows-latest | |
| - name: linux | |
| runner: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.3.14 | |
| - uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| workspaces: desktop/src-tauri | |
| key: ${{ matrix.platform.name }} | |
| - if: matrix.platform.name == 'linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - run: bun install --frozen-lockfile | |
| working-directory: desktop | |
| - run: bun run typecheck | |
| working-directory: desktop | |
| # `tauri build`, not `cargo build --release`. tauri-build emits `cargo:rustc-cfg=dev` | |
| # for anything the Tauri CLI did not build, so a plain cargo release binary still points | |
| # at the dev server and shows "Could not connect to localhost" when it is run. That | |
| # compiles, proves the Rust, and proves nothing about the thing people install. | |
| # | |
| # Bundling is included because the bundle is the product, and because the failures live | |
| # there: the Windows resource step needs an .ico, and macOS wants an .icns, neither of | |
| # which a compile would miss. | |
| - run: bun run tauri build | |
| working-directory: desktop | |
| # Frontend assets and platform dependencies are ready after the packaged build. | |
| # Include main.rs regressions as well as lib.rs; ignored live tests remain opt-in. | |
| - name: Rust regression tests | |
| run: cargo test --locked --lib --bins | |
| working-directory: desktop/src-tauri | |
| # Keep what was built. Without this the only way to try an installer is to build one on | |
| # the machine you are trying it on, which is not what anybody installs. | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: openbot-desktop-${{ matrix.platform.name }} | |
| path: | | |
| desktop/src-tauri/target/release/bundle/**/*.dmg | |
| desktop/src-tauri/target/release/bundle/**/*.exe | |
| desktop/src-tauri/target/release/bundle/**/*.AppImage | |
| desktop/src-tauri/target/release/bundle/**/*.deb | |
| desktop/src-tauri/target/release/bundle/**/*.rpm | |
| if-no-files-found: error | |
| retention-days: 7 |