diff --git a/.github/actions/build-rust/action.yml b/.github/actions/build-rust/action.yml index 3ef2b87907..f187641f85 100644 --- a/.github/actions/build-rust/action.yml +++ b/.github/actions/build-rust/action.yml @@ -14,10 +14,17 @@ inputs: runs: using: 'composite' steps: + - name: Print rustup toolchain version + shell: bash + id: rustup-version + run: | + export RUST_TOOLCHAIN_VERSION="$(grep 'channel' rust-toolchain.toml | head -1 | awk -F '"' '{print $2}')" + echo "Rust toolchain version: $RUST_TOOLCHAIN_VERSION" + echo "RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION" >> "$GITHUB_OUTPUT" - name: Setup Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: stable + toolchain: '${{ steps.rustup-version.outputs.RUST_TOOLCHAIN_VERSION }}' targets: ${{ inputs.target }} env: CARGO_INCREMENTAL: '1' @@ -49,6 +56,8 @@ runs: run: | export CC=x86_64-unknown-linux-gnu-gcc export CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc + rm -rf /usr/local/rustup/downloads/* + rustup target add x86_64-unknown-linux-gnu export RUSTFLAGS="-C debuginfo=1" yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }} if [ -d "node_modules/.cache" ]; then @@ -66,6 +75,8 @@ runs: options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build -e NX_CLOUD_ACCESS_TOKEN=${{ inputs.nx_token }} run: | export RUSTFLAGS="-C debuginfo=1" + rm -rf /usr/local/rustup/downloads/* + rustup target add aarch64-unknown-linux-gnu yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }} if [ -d "node_modules/.cache" ]; then chmod -R 777 node_modules/.cache diff --git a/README.md b/README.md index 10562298e3..513a0ff604 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ See [LICENSE] for details. [jobs available]: ./docs/jobs.md [latest packages]: https://github.com/toeverything/AFFiNE/pkgs/container/affine-self-hosted [contributor license agreement]: https://github.com/toeverything/affine/edit/canary/.github/CLA.md -[rust-version-icon]: https://img.shields.io/badge/Rust-1.71.0-dea584 +[rust-version-icon]: https://img.shields.io/badge/Rust-1.74.0-dea584 [stars-icon]: https://img.shields.io/github/stars/toeverything/AFFiNE.svg?style=flat&logo=github&colorB=red&label=stars [codecov]: https://codecov.io/gh/toeverything/affine/branch/canary/graphs/badge.svg?branch=canary [node-version-icon]: https://img.shields.io/badge/node-%3E=18.16.1-success diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..e7f52bc821 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.74.0" +profile = "default"