From 7818b9bcfaaa6702c02505eca92b93bd5fe09715 Mon Sep 17 00:00:00 2001 From: Tamo Date: Sun, 14 Sep 2025 13:01:43 +0200 Subject: [PATCH 1/2] update version --- .cargo/config.toml | 8 +++ .github/workflows/rust.yml | 99 -------------------------------------- Cargo.toml | 2 +- rust-toolchain | 2 +- 4 files changed, 10 insertions(+), 101 deletions(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..54dde54 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,8 @@ +# clipboard api is still unstable, so web-sys requires the below flag to be passed for copy (ctrl + c) to work +# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html +# check status at https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility +# we don't use `[build]` because of rust analyzer's build cache invalidation https://github.com/emilk/eframe_template/issues/93 +[target.wasm32-unknown-unknown] +rustflags = ["--cfg=web_sys_unstable_apis"] +[build] +target = "wasm32-unknown-unknown" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2a0458c..646e5b1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,21 +7,6 @@ env: RUSTDOCFLAGS: -D warnings jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features - check_wasm: name: Check wasm32 runs-on: ubuntu-latest @@ -37,23 +22,6 @@ jobs: with: command: check args: --all-features --lib --target wasm32-unknown-unknown - - test: - name: Test Suite - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev - - uses: actions-rs/cargo@v1 - with: - command: test - args: --lib - fmt: name: Rustfmt runs-on: ubuntu-latest @@ -101,70 +69,3 @@ jobs: run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- - name: Build run: ./trunk build - - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - TARGET: aarch64-apple-darwin - - - os: ubuntu-latest - TARGET: aarch64-unknown-linux-gnu - - - os: ubuntu-latest - TARGET: armv7-unknown-linux-gnueabihf - - - os: ubuntu-latest - TARGET: x86_64-unknown-linux-gnu - - - os: windows-latest - TARGET: x86_64-pc-windows-msvc - EXTENSION: .exe - - steps: - - name: Building ${{ matrix.TARGET }} - run: echo "${{ matrix.TARGET }}" - - - uses: actions/checkout@master - - name: Install build dependencies - Rustup - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile default --target ${{ matrix.TARGET }} -y - echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - # For linux, it's necessary to use cross from the git repository to avoid glibc problems - # Ref: https://github.com/cross-rs/cross/issues/1510 - - name: Install cross for linux - if: contains(matrix.TARGET, 'linux') - run: | - cargo install cross --git https://github.com/cross-rs/cross --rev 1b8cf50d20180c1a394099e608141480f934b7f7 - - - name: Install cross for mac and windows - if: ${{ !contains(matrix.TARGET, 'linux') }} - run: | - cargo install cross - - - name: Build - run: | - cross build --verbose --release --target=${{ matrix.TARGET }} - - - name: Rename - run: cp target/${{ matrix.TARGET }}/release/stools${{ matrix.EXTENSION }} stools-${{ matrix.TARGET }}${{ matrix.EXTENSION }} - - - uses: actions/upload-artifact@master - with: - name: stools-${{ matrix.TARGET }}${{ matrix.EXTENSION }} - path: stools-${{ matrix.TARGET }}${{ matrix.EXTENSION }} - - - uses: svenstaro/upload-release-action@v2 - name: Upload binaries to release - if: ${{ github.event_name == 'push' }} - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: stools-${{ matrix.TARGET }}${{ matrix.EXTENSION }} - asset_name: stools-${{ matrix.TARGET }}${{ matrix.EXTENSION }} - tag: ${{ github.ref }} - prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} - overwrite: true diff --git a/Cargo.toml b/Cargo.toml index 90bd03d..29798af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Luna "] edition = "2021" include = ["LICENSE-APACHE", "LICENSE-MIT", "**/*.rs", "Cargo.toml"] -rust-version = "1.81" +rust-version = "1.85" [package.metadata.docs.rs] all-features = true diff --git a/rust-toolchain b/rust-toolchain index dd9d16c..b353e93 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -5,6 +5,6 @@ # to the user in the error, instead of "error: invalid channel name '[toolchain]'". [toolchain] -channel = "1.81" # Avoid specifying a patch version here; see https://github.com/emilk/eframe_template/issues/145 +channel = "1.85" # Avoid specifying a patch version here; see https://github.com/emilk/eframe_template/issues/145 components = [ "rustfmt", "clippy" ] targets = [ "wasm32-unknown-unknown" ] From 2d9321306d5c51701f4430240ad5ee2a3bf80936 Mon Sep 17 00:00:00 2001 From: Tamo Date: Sun, 14 Sep 2025 13:03:15 +0200 Subject: [PATCH 2/2] add readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c9f52eb..457aa74 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +# To test the website + +Run: +``` +trunk serve +``` + + # eframe template [![dependency status](https://deps.rs/repo/github/emilk/eframe_template/status.svg)](https://deps.rs/repo/github/emilk/eframe_template)