diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index fa08868559..0e8ca7d4fd 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -1,5 +1,5 @@ -name: 'Setup environment' -description: 'Common GH action to setup job environment' +name: "Setup environment" +description: "Common GH action to setup job environment" runs: using: "composite" @@ -8,7 +8,7 @@ runs: uses: RDXWorks-actions/toolchain@master with: # IMPORTANT: - # To update the Rust version, you must update it in five total places (including the toolchain below): + # To update the Rust version, you must update it in eight total places (including the toolchain below): # => [README.md - part 1] Update "Install Rust - we recommend to use Rust X.XX.X" # => [README.md - part 2] Update "rustup default X.XX.X" # => [action.yml - part 1] Update "toolchain: X.XX.X" below @@ -17,6 +17,10 @@ runs: # different version is used. # => [Dockerfile] Update "FROM rust:X.XX.X-slim-bookworm AS base-image" in the deterministic builder # => [radix-clis/assets/template/rust-toolchain.toml_template] Update the rust version + # => [scrypto-install-scripts/*] Update the all version in each scripts "# Versions to install" section. Keep the current version number format: + # => [scrypto-install-scripts/install-scrypto-debian.sh] "LLVM_VERSION=XX", "RUST_VERSION=X.XX.X", "RADIX_CLI_VERSION=X.X.X" + # => [scrypto-install-scripts/install-scrypto-macos.sh] "LLVM_VERSION=XX", "RUST_VERSION=X.XX.X", "RADIX_CLI_VERSION=X.X.X" + # => [scrypto-install-scripts/install-scrypto-windows.ps1] "$llvmVersion = 'XX.X.X'", "$rustVersion = 'X.XX.X'", "$radixCliVersion = 'X.X.X'" # => [https://docs.radixdlt.com/docs/getting-rust-scrypto] Update the recommended rust version on docs toolchain: 1.81.0 default: true @@ -38,7 +42,7 @@ runs: if: runner.os == 'Linux' uses: RDXWorks-actions/actions-setup-cmake@master with: - cmake-version: '3.27.9' + cmake-version: "3.27.9" - name: Install libclang-dev if: runner.os == 'Linux' run: sudo apt-get -y update && sudo apt-get install clang libclang-dev -y -f diff --git a/scrypto-install-scripts/install-scrypto-debian.sh b/scrypto-install-scripts/install-scrypto-debian.sh index 8c40ae7139..1c3b2b52f7 100644 --- a/scrypto-install-scripts/install-scrypto-debian.sh +++ b/scrypto-install-scripts/install-scrypto-debian.sh @@ -3,6 +3,11 @@ # Exit on error set -e +# Versions to install +LLVM_VERSION=18 +RUST_VERSION=1.81.0 +RADIX_CLI_VERSION=1.3.0 + # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' @@ -52,7 +57,7 @@ install_llvm() { sudo apt-get update # Install build essentials and LLVM - sudo apt-get install -y clang build-essential llvm + sudo apt-get install -y clang build-essential llvm-$LLVM_VERSION if [ $? -eq 0 ]; then log "SUCCESS" "LLVM and build essentials installed successfully" @@ -67,7 +72,7 @@ install_rust() { log "INFO" "Installing Rust..." # Download and install Rust with specific toolchain - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.81.0 -y + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=$RUST_VERSION -y if [ $? -eq 0 ]; then log "SUCCESS" "Rust installed successfully" @@ -110,7 +115,7 @@ add_wasm_target() { install_radix_tools() { log "INFO" "Installing Radix Engine Simulator and CLI tools..." - cargo install --force radix-clis@1.3.0 + cargo install --force radix-clis@$RADIX_CLI_VERSION if [ $? -eq 0 ]; then log "SUCCESS" "Radix tools installed successfully" diff --git a/scrypto-install-scripts/install-scrypto-macos.sh b/scrypto-install-scripts/install-scrypto-macos.sh index 0808933ced..0ed66f6f90 100755 --- a/scrypto-install-scripts/install-scrypto-macos.sh +++ b/scrypto-install-scripts/install-scrypto-macos.sh @@ -3,6 +3,11 @@ # Print commands and exit on errors set -ex +# Versions to install +LLVM_VERSION=18 +RUST_VERSION=1.81.0 +RADIX_CLI_VERSION=1.3.0 + # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' @@ -28,7 +33,7 @@ check_status "Xcode Command Line Tools installation" # Install cmake and LLVM echo -e "\n${BLUE}Installing cmake and LLVM...${NC}" -brew install cmake llvm@17 +brew install cmake llvm@$LLVM_VERSION check_status "cmake and LLVM installation" # Detect shell and configure appropriate rc file @@ -44,14 +49,14 @@ fi # Add LLVM to PATH echo -e "\n${BLUE}Configuring LLVM in $SHELL_CONFIG...${NC}" -if ! grep -q "$(brew --prefix llvm@18)/bin" "$SHELL_CONFIG"; then - echo 'PATH="$(brew --prefix llvm@18)/bin:$PATH"' >> "$SHELL_CONFIG" +if ! grep -q "$(brew --prefix llvm@${LLVM_VERSION})/bin" "$SHELL_CONFIG"; then + echo 'PATH="$(brew --prefix llvm@'$LLVM_VERSION')/bin:$PATH"' >> "$SHELL_CONFIG" fi check_status "LLVM path configuration" # Install Rust echo -e "\n${BLUE}Installing Rust...${NC}" -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=1.81.0 -y +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=$RUST_VERSION -y check_status "Rust installation" # Source cargo environment @@ -66,7 +71,7 @@ check_status "WebAssembly target installation" # Install Radix Engine Simulator and CLI tools echo -e "\n${BLUE}Installing Radix Engine Simulator and CLI tools...${NC}" -cargo install --force radix-clis@1.3.0 +cargo install --force radix-clis@$RADIX_CLI_VERSION check_status "Radix tools installation" echo -e "\n${GREEN}Installation complete! Please restart your terminal or run:${NC}" diff --git a/scrypto-install-scripts/install-scrypto-windows.ps1 b/scrypto-install-scripts/install-scrypto-windows.ps1 index 37c6de78c7..79ed9b4efb 100644 --- a/scrypto-install-scripts/install-scrypto-windows.ps1 +++ b/scrypto-install-scripts/install-scrypto-windows.ps1 @@ -1,9 +1,14 @@ # Requires PowerShell running as Administrator #Requires -RunAsAdministrator +# Versions to install +$llvmVersion = '18.1.8' +$rustVersion = '1.81.0' +$radixCliVersion = '1.3.0' + # Script configuration -$ErrorActionPreference = "Stop" -$ProgressPreference = "Continue" +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'Continue' # Colors for output function Write-ColorOutput($ForegroundColor) { @@ -85,7 +90,6 @@ if (!(Test-Path $vsInstallerPath)) { } # 3. Install LLVM -$llvmVersion = "18.1.8" Install-IfNotPresent "LLVM" "clang" { Write-ColorOutput Cyan "Downloading LLVM..." @@ -104,7 +108,6 @@ Install-IfNotPresent "LLVM" "clang" { } # 4. Install Rust -$rustVersion = "1.81.0" Install-IfNotPresent "Rust" "rustc" { Write-ColorOutput Cyan "Downloading and installing Rust..." $rustupInit = "$env:TEMP\rustup-init.exe" @@ -123,7 +126,7 @@ rustup target add wasm32-unknown-unknown # 7. Install Radix Engine Simulator and CLI tools Write-ColorOutput Cyan "Installing Radix Engine Simulator and CLI tools..." -cargo install --force radix-clis@1.3.0 +cargo install --force radix-clis@$radixCliVersion Refresh-EnvironmentVariables # Final success message