From 623b014eac987baabcb01e5805567fa7dc67748a Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 4 Feb 2026 12:36:18 +0100 Subject: [PATCH 01/11] Add .clang-format and update .gitignore --- .clang-format | 18 ++++++++++++++++++ .gitignore | 12 ++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..4e0c9e095 --- /dev/null +++ b/.clang-format @@ -0,0 +1,18 @@ +--- +Language: Cpp +BasedOnStyle: LLVM + +# 4 spaces everywhere +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +ContinuationIndentWidth: 4 + +# Modern C++ style +Standard: c++20 +ColumnLimit: 120 +PointerAlignment: Left + +# Organize includes +SortIncludes: true +IncludeBlocks: Regroup diff --git a/.gitignore b/.gitignore index 796da3f24..00964c7e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -.* -!/.ci/ -!.git* -!.travis.yml -/target -/tests/tmp +# Cargo build files +target + +# Temporary test files +tests/**/tmp +tests/**/.bender From cf46b2e997445d58c4b3671edcefe44091f58f39 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Thu, 12 Feb 2026 15:40:40 +0100 Subject: [PATCH 02/11] tests: Add pickle testing repo --- tests/pickle/Bender.lock | 1 + tests/pickle/Bender.yml | 15 +++++++++++++ tests/pickle/include/macros.svh | 6 ++++++ tests/pickle/src/bus_intf.sv | 21 +++++++++++++++++++ tests/pickle/src/common_pkg.sv | 13 ++++++++++++ tests/pickle/src/top.sv | 37 +++++++++++++++++++++++++++++++++ 6 files changed, 93 insertions(+) create mode 100644 tests/pickle/Bender.lock create mode 100644 tests/pickle/Bender.yml create mode 100644 tests/pickle/include/macros.svh create mode 100644 tests/pickle/src/bus_intf.sv create mode 100644 tests/pickle/src/common_pkg.sv create mode 100644 tests/pickle/src/top.sv diff --git a/tests/pickle/Bender.lock b/tests/pickle/Bender.lock new file mode 100644 index 000000000..c33c0b6df --- /dev/null +++ b/tests/pickle/Bender.lock @@ -0,0 +1 @@ +packages: {} diff --git a/tests/pickle/Bender.yml b/tests/pickle/Bender.yml new file mode 100644 index 000000000..fdc42d00e --- /dev/null +++ b/tests/pickle/Bender.yml @@ -0,0 +1,15 @@ +package: + name: pickle_repo + +sources: + - defines: + ENABLE_LOGGING: 1 + files: + - src/common_pkg.sv + - src/bus_intf.sv + + - target: top + include_dirs: + - include + files: + - src/top.sv diff --git a/tests/pickle/include/macros.svh b/tests/pickle/include/macros.svh new file mode 100644 index 000000000..a041281aa --- /dev/null +++ b/tests/pickle/include/macros.svh @@ -0,0 +1,6 @@ +// Simple macro to test if includes are resolved correctly +`define LOG(msg) \ + $display("[LOG]: %s", msg); + +// A constant used in the RTL +localparam int unsigned DataWidth = 32; diff --git a/tests/pickle/src/bus_intf.sv b/tests/pickle/src/bus_intf.sv new file mode 100644 index 000000000..bcd581028 --- /dev/null +++ b/tests/pickle/src/bus_intf.sv @@ -0,0 +1,21 @@ +interface bus_intf #( + parameter int Width = 32 +) ( + input logic clk +); + logic [Width-1:0] addr; + logic [Width-1:0] data; + logic valid; + logic ready; + + modport master ( + output addr, data, valid, + input ready + ); + + modport slave ( + input addr, data, valid, + output ready + ); + +endinterface diff --git a/tests/pickle/src/common_pkg.sv b/tests/pickle/src/common_pkg.sv new file mode 100644 index 000000000..7a2d02d59 --- /dev/null +++ b/tests/pickle/src/common_pkg.sv @@ -0,0 +1,13 @@ +package common_pkg; + + typedef enum logic [1:0] { + Idle = 2'b00, + Busy = 2'b01, + Error = 2'b11 + } state_t; + + function automatic logic is_error(state_t s); + return s == Error; + endfunction + +endpackage diff --git a/tests/pickle/src/top.sv b/tests/pickle/src/top.sv new file mode 100644 index 000000000..daaab9edc --- /dev/null +++ b/tests/pickle/src/top.sv @@ -0,0 +1,37 @@ +`include "macros.svh" + +import common_pkg::*; + +module top ( + input logic clk, + input logic rst_n +); + + // Interface Instantiation + bus_intf #(.WIDTH(DATA_WIDTH)) axi_bus ( + .clk(clk) + ); + + // Virtual Interface Type + virtual bus_intf v_if_handle; + + initial begin + v_if_handle = axi_bus; + +`ifdef ENABLE_LOGGING + `LOG("TopModule started successfully!") +`endif + end + + // Type Usage from Package (state_t) + common_pkg::state_t current_state; + + always_ff @(posedge clk or negedge rst_n) begin + if (!rst_n) begin + current_state <= Idle; + end else begin + current_state <= Busy; + end + end + +endmodule From 50faf0b79ca3d4c70f59769b4f7519dc70f27244 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 16 Feb 2026 22:48:46 +0100 Subject: [PATCH 03/11] bender-slang: Add unit and integration tests --- crates/bender-slang/tests/basic.rs | 37 +++++++++++++++ tests/cli_regression.rs | 3 ++ tests/pickle.rs | 75 ++++++++++++++++++++++++++++++ tests/pickle/Bender.yml | 4 ++ tests/pickle/src/broken.sv | 2 + tests/pickle/src/core.sv | 3 ++ tests/pickle/src/leaf.sv | 2 + tests/pickle/src/top.sv | 2 + tests/pickle/src/unused_leaf.sv | 2 + tests/pickle/src/unused_top.sv | 3 ++ 10 files changed, 133 insertions(+) create mode 100644 crates/bender-slang/tests/basic.rs create mode 100644 tests/pickle.rs create mode 100644 tests/pickle/src/broken.sv create mode 100644 tests/pickle/src/core.sv create mode 100644 tests/pickle/src/leaf.sv create mode 100644 tests/pickle/src/unused_leaf.sv create mode 100644 tests/pickle/src/unused_top.sv diff --git a/crates/bender-slang/tests/basic.rs b/crates/bender-slang/tests/basic.rs new file mode 100644 index 000000000..03d45538f --- /dev/null +++ b/crates/bender-slang/tests/basic.rs @@ -0,0 +1,37 @@ +use std::path::PathBuf; + +fn fixture_path(rel: &str) -> String { + PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../..") + .join("tests/pickle") + .join(rel) + .canonicalize() + .expect("valid fixture path") + .to_string_lossy() + .into_owned() +} + +#[test] +fn parse_valid_file_succeeds() { + let mut session = bender_slang::SlangSession::new(); + let files = vec![fixture_path("src/top.sv")]; + let includes = vec![fixture_path("include")]; + let defines = vec![]; + assert!(session.parse_group(&files, &includes, &defines).is_ok()); + assert_eq!(session.tree_count(), 1); +} + +#[test] +fn parse_invalid_file_returns_parse_error() { + let mut session = bender_slang::SlangSession::new(); + let files = vec![fixture_path("src/broken.sv")]; + let includes = vec![]; + let defines = vec![]; + let result = session.parse_group(&files, &includes, &defines); + + match result { + Err(bender_slang::SlangError::ParseGroup { .. }) => {} + Err(other) => panic!("expected SlangError::ParseGroup, got {other}"), + Ok(_) => panic!("expected parse to fail"), + } +} diff --git a/tests/cli_regression.rs b/tests/cli_regression.rs index c75b37bfe..66f652eeb 100644 --- a/tests/cli_regression.rs +++ b/tests/cli_regression.rs @@ -161,5 +161,8 @@ regression_tests! { packages: &["packages"], packages_graph: &["packages", "--graph"], packages_flat: &["packages", "--flat"], + // Enable once the golden binary is built with `slang` support. + // pickle_basic: &["pickle", "--target", "top"], + // pickle_top_trim: &["pickle", "--target", "top", "--top", "top"], } diff --git a/tests/pickle.rs b/tests/pickle.rs new file mode 100644 index 000000000..307b8bf2b --- /dev/null +++ b/tests/pickle.rs @@ -0,0 +1,75 @@ +// Copyright (c) 2025 ETH Zurich +// Tim Fischer + +#[cfg(feature = "slang")] +mod tests { + use assert_cmd::cargo; + + fn run_pickle(args: &[&str]) -> String { + let mut full_args = vec!["-d", "tests/pickle", "pickle"]; + full_args.extend(args); + + let out = cargo::cargo_bin_cmd!() + .args(&full_args) + .output() + .expect("Failed to execute bender binary"); + + assert!( + out.status.success(), + "pickle command failed.\nstdout:\n{}\nstderr:\n{}", + String::from_utf8_lossy(&out.stdout), + String::from_utf8_lossy(&out.stderr) + ); + + String::from_utf8(out.stdout).expect("stdout must be utf-8") + } + + #[test] + fn pickle_top_trim_filters_unreachable_modules() { + let full = run_pickle(&["--target", "top"]); + assert!(full.contains("module unused_top;")); + assert!(full.contains("module unused_leaf;")); + + let trimmed = run_pickle(&["--target", "top", "--top", "top"]); + assert!(trimmed.contains("module top (")); + assert!(trimmed.contains("module core;")); + assert!(trimmed.contains("module leaf;")); + assert!(!trimmed.contains("module unused_top;")); + assert!(!trimmed.contains("module unused_leaf;")); + } + + #[test] + fn pickle_rename_applies_prefix_and_suffix() { + let renamed = run_pickle(&[ + "--target", "top", "--top", "top", "--prefix", "p_", "--suffix", "_s", + ]); + + assert!(renamed.contains("module p_top_s (")); + assert!(renamed.contains("module p_core_s;")); + assert!(renamed.contains("module p_leaf_s;")); + } + + #[test] + fn pickle_exclude_rename_keeps_selected_names() { + let renamed = run_pickle(&[ + "--target", + "top", + "--top", + "top", + "--prefix", + "p_", + "--suffix", + "_s", + "--exclude-rename", + "top", + "--exclude-rename", + "core", + ]); + + assert!(renamed.contains("module top (")); + assert!(renamed.contains("module core;")); + assert!(renamed.contains("module p_leaf_s;")); + assert!(!renamed.contains("module p_top_s (")); + assert!(!renamed.contains("module p_core_s;")); + } +} diff --git a/tests/pickle/Bender.yml b/tests/pickle/Bender.yml index fdc42d00e..c5724f952 100644 --- a/tests/pickle/Bender.yml +++ b/tests/pickle/Bender.yml @@ -7,6 +7,10 @@ sources: files: - src/common_pkg.sv - src/bus_intf.sv + - src/leaf.sv + - src/core.sv + - src/unused_leaf.sv + - src/unused_top.sv - target: top include_dirs: diff --git a/tests/pickle/src/broken.sv b/tests/pickle/src/broken.sv new file mode 100644 index 000000000..0fbcdfa50 --- /dev/null +++ b/tests/pickle/src/broken.sv @@ -0,0 +1,2 @@ +module broken(; +endmodule diff --git a/tests/pickle/src/core.sv b/tests/pickle/src/core.sv new file mode 100644 index 000000000..ce4f14c49 --- /dev/null +++ b/tests/pickle/src/core.sv @@ -0,0 +1,3 @@ +module core; + leaf u_leaf(); +endmodule diff --git a/tests/pickle/src/leaf.sv b/tests/pickle/src/leaf.sv new file mode 100644 index 000000000..5a7a547a2 --- /dev/null +++ b/tests/pickle/src/leaf.sv @@ -0,0 +1,2 @@ +module leaf; +endmodule diff --git a/tests/pickle/src/top.sv b/tests/pickle/src/top.sv index daaab9edc..2365ab895 100644 --- a/tests/pickle/src/top.sv +++ b/tests/pickle/src/top.sv @@ -7,6 +7,8 @@ module top ( input logic rst_n ); + core u_core(); + // Interface Instantiation bus_intf #(.WIDTH(DATA_WIDTH)) axi_bus ( .clk(clk) diff --git a/tests/pickle/src/unused_leaf.sv b/tests/pickle/src/unused_leaf.sv new file mode 100644 index 000000000..f7d261d00 --- /dev/null +++ b/tests/pickle/src/unused_leaf.sv @@ -0,0 +1,2 @@ +module unused_leaf; +endmodule diff --git a/tests/pickle/src/unused_top.sv b/tests/pickle/src/unused_top.sv new file mode 100644 index 000000000..a62e36504 --- /dev/null +++ b/tests/pickle/src/unused_top.sv @@ -0,0 +1,3 @@ +module unused_top; + unused_leaf u_unused_leaf(); +endmodule From 9bbd9bdf02a911cd39c2a8fc8bc7cddd69543a51 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 16 Feb 2026 23:46:21 +0100 Subject: [PATCH 04/11] bender-slang: Add `.clangd` file for IDE support --- .clangd | 15 ++++++++++ .gitignore | 3 ++ crates/bender-slang/build.rs | 38 +++++++++++++++++++++++- crates/bender-slang/cpp/slang_bridge.cpp | 3 -- crates/bender-slang/cpp/slang_bridge.h | 4 +-- 5 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 .clangd diff --git a/.clangd b/.clangd new file mode 100644 index 000000000..e1f5bf28a --- /dev/null +++ b/.clangd @@ -0,0 +1,15 @@ +If: + PathMatch: (^|.*/)crates/bender-slang/cpp/.*\.(h|hpp|hh|c|cc|cpp|cxx)$ +CompileFlags: + Add: + - -std=c++20 + - -fno-cxx-modules + - -I. + - -I../../../crates + - -I../vendor/slang/include + - -I../vendor/slang/external + - -I../../../target/slang-generated-include + - -I../../../target/cxxbridge + - -DSLANG_USE_MIMALLOC=1 + - -DSLANG_USE_THREADS=1 + - -DSLANG_BOOST_SINGLE_HEADER=1 diff --git a/.gitignore b/.gitignore index 00964c7e3..eeeddced9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ target # Temporary test files tests/**/tmp tests/**/.bender + +# clangd +.cache/clangd diff --git a/crates/bender-slang/build.rs b/crates/bender-slang/build.rs index 7db0396f7..faf39b8f3 100644 --- a/crates/bender-slang/build.rs +++ b/crates/bender-slang/build.rs @@ -1,6 +1,37 @@ // Copyright (c) 2025 ETH Zurich // Tim Fischer +#[cfg(unix)] +// We create a symlink from the generated include directory to a stable location in the target directory +// so that tools like clangd can find the headers without needing to know the exact OUT_DIR path. +// This is purely for improving the development experience and is not necessary for the build itself. +fn refresh_include_symlink(generated_include_dir: &std::path::Path) { + use std::ffi::OsStr; + use std::fs; + use std::os::unix::fs::symlink; + use std::path::PathBuf; + + let Ok(out_dir) = std::env::var("OUT_DIR") else { + return; + }; + let out_dir = PathBuf::from(out_dir); + + let Some(target_root) = out_dir + .ancestors() + .find(|path| path.file_name() == Some(OsStr::new("target"))) + else { + return; + }; + + let stable_link = target_root.join("slang-generated-include"); + let _ = fs::remove_file(&stable_link); + let _ = fs::remove_dir_all(&stable_link); + let _ = symlink(generated_include_dir, &stable_link); +} + +#[cfg(not(unix))] +fn refresh_include_symlink(_generated_include_dir: &std::path::Path) {} + fn main() { let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap(); @@ -64,6 +95,11 @@ fn main() { let dst = slang_lib.build(); let lib_dir = dst.join("lib"); + // Create a symlink for the generated include directory + if target_os == "linux" || target_os == "macos" { + refresh_include_symlink(&dst.join("include")); + } + // Configure Linker to find Slang static library println!("cargo:rustc-link-search=native={}", lib_dir.display()); println!("cargo:rustc-link-lib=static=svlang"); @@ -97,7 +133,7 @@ fn main() { let compiler = std::env::var("CXX").unwrap_or_else(|_| "g++".to_string()); // We search for the static libstdc++ file using g++ let output = std::process::Command::new(&compiler) - .args(&["-print-file-name=libstdc++.a"]) + .args(["-print-file-name=libstdc++.a"]) .output() .expect("Failed to run g++"); diff --git a/crates/bender-slang/cpp/slang_bridge.cpp b/crates/bender-slang/cpp/slang_bridge.cpp index 755690992..7e7c02eb7 100644 --- a/crates/bender-slang/cpp/slang_bridge.cpp +++ b/crates/bender-slang/cpp/slang_bridge.cpp @@ -4,8 +4,6 @@ #include "slang_bridge.h" #include "bender-slang/src/lib.rs.h" -#include "slang/diagnostics/DiagnosticEngine.h" -#include "slang/diagnostics/TextDiagnosticClient.h" #include "slang/syntax/CSTSerializer.h" #include "slang/syntax/SyntaxPrinter.h" #include "slang/syntax/SyntaxVisitor.h" @@ -17,7 +15,6 @@ #include using namespace slang; -using namespace slang::driver; using namespace slang::syntax; using namespace slang::parsing; diff --git a/crates/bender-slang/cpp/slang_bridge.h b/crates/bender-slang/cpp/slang_bridge.h index a309b5a95..faa4431d1 100644 --- a/crates/bender-slang/cpp/slang_bridge.h +++ b/crates/bender-slang/cpp/slang_bridge.h @@ -7,13 +7,13 @@ #include "rust/cxx.h" #include "slang/diagnostics/DiagnosticEngine.h" #include "slang/diagnostics/TextDiagnosticClient.h" -#include "slang/driver/Driver.h" +#include "slang/parsing/Preprocessor.h" #include "slang/syntax/SyntaxTree.h" +#include "slang/text/SourceManager.h" #include #include #include -#include #include struct SlangPrintOpts; From bc381de9054b6052ca0e6405f479a51abb095496 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Mon, 16 Feb 2026 23:56:27 +0100 Subject: [PATCH 05/11] ci: Add clang-format check + separate rustfmt --- .github/workflows/ci.yml | 3 --- .github/workflows/formatting.yml | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/formatting.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4420a4f4e..d7bcfff33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,13 +26,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust}} - components: rustfmt - name: Build run: cargo build --all-features - name: Cargo Test run: cargo test --workspace --all-features - - name: Format (fix with `cargo fmt`) - run: cargo fmt -- --check - name: Run unit-tests run: tests/run_all.sh shell: bash diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 000000000..f81cf6392 --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,35 @@ +name: formatting + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + rustfmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: rustfmt + - name: Check Rust formatting + run: cargo fmt -- --check + + clang-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + submodules: recursive + - name: Check C/C++ formatting + uses: DoozyX/clang-format-lint-action@v0.18 + with: + source: "." + extensions: "h,hpp,c,cc,cpp,cxx" + exclude: "./crates/bender-slang/vendor" From 164533cac4763112ca13e5bd8ba45cb344da3d9e Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 17 Feb 2026 13:38:08 +0100 Subject: [PATCH 06/11] ci: Run on PRs to non-main branches --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7bcfff33..825a89cba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: [master] pull_request: - branches: [master] workflow_dispatch: jobs: From a6b2fa7b2ddf33cd0d24aded2b5a69fc3496ee0e Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 17 Feb 2026 09:05:02 +0100 Subject: [PATCH 07/11] ci: Add release build jobs --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 825a89cba..162d3d95b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,26 @@ jobs: run: tests/run_all.sh shell: bash + release-build: + name: Release Build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + - macos-latest + steps: + - uses: actions/checkout@v6 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Build (release) + run: cargo build --release --all-features + clippy_check: name: Clippy runs-on: ubuntu-latest From da32be74b95b819d377ff42004d0d9237f66b5d5 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 17 Feb 2026 11:11:04 +0100 Subject: [PATCH 08/11] ci(release): Clone recursively, use all features, allow dry-run workflow dispatch --- .github/workflows/release.yaml | 38 +++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2df026bd0..ae5e1f63b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,12 @@ on: release: types: [created] workflow_dispatch: + inputs: + publish_assets: + description: "Upload release assets" + required: false + default: false + type: boolean jobs: release_amd64: @@ -61,7 +67,9 @@ jobs: platform: - linux/amd64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: recursive - name: OS Build run: | export full_tgtname=${{ matrix.os }} @@ -85,6 +93,7 @@ jobs: .github/scripts/package.sh $platform $tgtname; shell: bash - name: Upload Release Asset + if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.release.tag_name }} @@ -106,7 +115,9 @@ jobs: platform: - linux/arm64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: recursive - name: OS Build run: | export full_tgtname=${{ matrix.os }} @@ -130,6 +141,7 @@ jobs: .github/scripts/package.sh $platform $tgtname; shell: bash - name: Upload Release Asset + if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.release.tag_name }} @@ -141,7 +153,9 @@ jobs: # Use container that supports old GLIBC versions and (hopefully) many linux OSs # container: quay.io/pypa/manylinux2014_x86_64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: recursive - name: Setup Dockerfile run: | touch Dockerfile @@ -175,6 +189,7 @@ jobs: run: .github/scripts/package.sh amd64 shell: bash - name: Upload Release Asset + if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.release.tag_name }} @@ -186,7 +201,9 @@ jobs: # Use container that supports old GLIBC versions and (hopefully) many linux OSs # container: quay.io/pypa/manylinux2014_aarch64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: recursive - name: Setup Dockerfile run: | touch Dockerfile @@ -220,6 +237,7 @@ jobs: run: .github/scripts/package.sh arm64 shell: bash - name: Upload Release Asset + if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.release.tag_name }} @@ -229,7 +247,9 @@ jobs: release-macos: runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: recursive - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://https://sh.rustup.rs | sh -s -- -y --default-toolchain stable @@ -256,6 +276,7 @@ jobs: run: | gtar -czf $ARTIFACT_PATHNAME -C "./target/universal2-apple-darwin/release" --owner=0 --group=0 bender - name: Upload Release Asset + if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.release.tag_name }} @@ -265,13 +286,15 @@ jobs: release-windows: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: recursive - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Build - run: cargo build --release + run: cargo build --release --all-features - name: Get Artifact Name shell: bash run: | @@ -289,6 +312,7 @@ jobs: cp target/release/bender.exe . & 'C:\Program Files\Git\usr\bin\tar.exe' czf $Env:ARTIFACT_PATHNAME --owner=0 --group=0 bender.exe - name: Upload Release Asset + if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.release.tag_name }} From a39557e02218b1a320fdf089a4116fcc329d06d9 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 17 Feb 2026 14:35:17 +0100 Subject: [PATCH 09/11] ci(release): Add separate builds for slang and non-slang versions --- .github/scripts/gen_dockerfile.sh | 58 ------ .github/workflows/release.yaml | 312 ++++++++++-------------------- 2 files changed, 100 insertions(+), 270 deletions(-) delete mode 100755 .github/scripts/gen_dockerfile.sh diff --git a/.github/scripts/gen_dockerfile.sh b/.github/scripts/gen_dockerfile.sh deleted file mode 100755 index 512e9700e..000000000 --- a/.github/scripts/gen_dockerfile.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -export filename="Dockerfile" -rm -f $filename -touch $filename - -if [ $(echo $full_tgtname | cut -d ':' -f 1) = "rhel" ]; then - export maj_version=$(echo $full_tgtname | cut -d ':' -f 2) - export full_tgtname=redhat/ubi$(echo $maj_version | cut -d '.' -f 1):$(echo $full_tgtname | cut -d ':' -f 2) - if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 1) = '9' ]; then - if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 2) = '0' ]; then - export full_tgtname=$full_tgtname.0 - fi - if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 2) = '1' ]; then - export full_tgtname=$full_tgtname.0 - fi - fi -fi - -echo "FROM $full_tgtname" >> $filename -echo >> $filename -if [ $(echo $full_tgtname | cut -d ':' -f 1) = "centos" ]; then - echo "RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo" >> $filename - echo "RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo" >> $filename - echo "RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo" >> $filename - - echo "RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*" >> $filename - echo "RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*" >> $filename - echo 'RUN yum group install "Development Tools" -y && yum clean all' >> $filename -fi -if [ $(echo $full_tgtname | cut -d ':' -f 1) = "ubuntu" ]; then - echo 'RUN apt update && apt -y install build-essential curl' >> $filename -fi -if [ $(echo $full_tgtname | cut -d ':' -f 1) = "fedora" ]; then - echo 'RUN dnf -y update && dnf -y install @development-tools' >> $filename -fi -if [ $(echo $full_tgtname | cut -d ':' -f 1) = "debian" ]; then - echo 'RUN apt update && apt -y install build-essential curl gcc make' >> $filename -fi -if [ $(echo $full_tgtname | cut -d ':' -f 1) = "almalinux" ]; then - if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 1) = '8' ]; then - echo 'RUN rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux' >> $filename - fi - echo 'RUN dnf -y update && dnf -y group install "Development Tools"' >> $filename -fi -if [[ $(echo $full_tgtname | cut -d ':' -f 1) == "redhat"* ]]; then - echo 'RUN dnf -y install gcc' >> $filename -fi -echo >> $filename -echo 'ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo' >> $filename -echo 'ENV PATH=$CARGO_HOME/bin:$PATH' >> $filename -echo >> $filename -echo 'RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \' >> $filename -echo ' curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \' >> $filename -echo ' chmod -R a=rwX $CARGO_HOME' >> $filename -echo >> $filename -echo 'WORKDIR /source' >> $filename - diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ae5e1f63b..1506bf5f7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,310 +12,198 @@ on: type: boolean jobs: - release_amd64: + release-linux-compat-amd64: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust: - - stable - os: - - centos:7.4.1708 - - centos:7.6.1810 - - centos:7.7.1908 - - centos:7.8.2003 - - centos:7.9.2009 - - ubuntu:18.04 - - ubuntu:20.04 - - ubuntu:22.04 - - ubuntu:24.04 - - fedora:42 - - fedora:43 - - debian:11 - - debian:12 - - debian:13 - - rhel:8.6 - - rhel:8.7 - - rhel:8.8 - - rhel:8.9 - - rhel:8.10 - - rhel:9.0 - - rhel:9.1 - - rhel:9.2 - - rhel:9.3 - - rhel:9.4 - - rhel:9.5 - - rhel:9.6 - - rhel:9.7 - - rhel:10.0 - - rhel:10.1 - - almalinux:8.6 - - almalinux:8.7 - - almalinux:8.8 - - almalinux:8.9 - - almalinux:8.10 - - almalinux:9.0 - - almalinux:9.1 - - almalinux:9.2 - - almalinux:9.3 - - almalinux:9.4 - - almalinux:9.5 - - almalinux:9.6 - - almalinux:9.7 - - almalinux:10.0 - - almalinux:10.1 - platform: - - linux/amd64 steps: - uses: actions/checkout@v6 with: submodules: recursive - - name: OS Build + - name: Build (old-glibc baseline) run: | - export full_tgtname=${{ matrix.os }} - export tgtname=$(echo ${{ matrix.os }} | tr -d ':') - export full_platform=${{ matrix.platform }} - export platform=$(echo ${{ matrix.platform }} | awk -F'/' '{print $NF}') - .github/scripts/gen_dockerfile.sh - docker build ./ -t $tgtname-$platform --platform $full_platform docker run \ -t --rm \ -v "$GITHUB_WORKSPACE:/source" \ - -v "$GITHUB_WORKSPACE/target/$platform/$tgtname:/source/target" \ - --platform $full_platform \ - $tgtname-$platform \ - cargo build --release --all-features; - shell: bash - - name: OS Create Package - run: | - export tgtname=$(echo ${{ matrix.os }} | tr -d ':') - export platform=$(echo ${{ matrix.platform }} | awk -F'/' '{print $NF}') - .github/scripts/package.sh $platform $tgtname; + -v "$GITHUB_WORKSPACE/target/amd64:/source/target" \ + --platform linux/amd64 \ + quay.io/pypa/manylinux2014_x86_64 \ + /bin/bash -lc ' + set -euo pipefail + export RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo + export PATH=$CARGO_HOME/bin:$PATH + mkdir -p "$CARGO_HOME" "$RUSTUP_HOME" + curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + cd /source + cargo build --release + ' + - name: Create Package + run: .github/scripts/package.sh amd64 shell: bash - name: Upload Release Asset if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.event.release.tag_name }} - files: bender-*.tar.gz + tag_name: ${{ github.event.release.tag_name || github.ref_name }} + files: bender-*-x86_64-linux-gnu.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - release_arm64: + + release-linux-compat-arm64: runs-on: ubuntu-24.04-arm - strategy: - fail-fast: false - matrix: - rust: - - stable - os: - - ubuntu:18.04 - - ubuntu:20.04 - - ubuntu:22.04 - - ubuntu:24.04 - platform: - - linux/arm64 steps: - uses: actions/checkout@v6 with: submodules: recursive - - name: OS Build + - name: Build (old-glibc baseline) run: | - export full_tgtname=${{ matrix.os }} - export tgtname=$(echo ${{ matrix.os }} | tr -d ':') - export full_platform=${{ matrix.platform }} - export platform=$(echo ${{ matrix.platform }} | awk -F'/' '{print $NF}') - .github/scripts/gen_dockerfile.sh - docker build ./ -t $tgtname-$platform --platform $full_platform docker run \ -t --rm \ -v "$GITHUB_WORKSPACE:/source" \ - -v "$GITHUB_WORKSPACE/target/$platform/$tgtname:/source/target" \ - --platform $full_platform \ - $tgtname-$platform \ - cargo build --release --all-features; - shell: bash - - name: OS Create Package - run: | - export tgtname=$(echo ${{ matrix.os }} | tr -d ':') - export platform=$(echo ${{ matrix.platform }} | awk -F'/' '{print $NF}') - .github/scripts/package.sh $platform $tgtname; + -v "$GITHUB_WORKSPACE/target/arm64:/source/target" \ + --platform linux/arm64 \ + quay.io/pypa/manylinux2014_aarch64 \ + /bin/bash -lc ' + set -euo pipefail + export RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo + export PATH=$CARGO_HOME/bin:$PATH + mkdir -p "$CARGO_HOME" "$RUSTUP_HOME" + curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + cd /source + cargo build --release + ' + - name: Create Package + run: .github/scripts/package.sh arm64 shell: bash - name: Upload Release Asset if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.event.release.tag_name }} - files: bender-*.tar.gz + tag_name: ${{ github.event.release.tag_name || github.ref_name }} + files: bender-*-arm64-linux-gnu.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - release-gnu_amd64: + + release-linux-modern-amd64: runs-on: ubuntu-latest - # Use container that supports old GLIBC versions and (hopefully) many linux OSs - # container: quay.io/pypa/manylinux2014_x86_64 steps: - uses: actions/checkout@v6 with: submodules: recursive - - name: Setup Dockerfile - run: | - touch Dockerfile - echo "FROM quay.io/pypa/manylinux2014_x86_64" >> Dockerfile - echo "RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo" >> Dockerfile - echo "RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo" >> Dockerfile - echo "RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo" >> Dockerfile - - echo "RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*" >> Dockerfile - echo "RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*" >> Dockerfile - echo "RUN yum group install "Development Tools" -y && yum clean all" >> Dockerfile - echo 'ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo' >> Dockerfile - echo 'ENV PATH=$CARGO_HOME/bin:$PATH' >> Dockerfile - echo >> Dockerfile - echo 'RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \' >> Dockerfile - echo ' curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \' >> Dockerfile - echo ' chmod -R a=rwX $CARGO_HOME' >> Dockerfile - echo >> Dockerfile - echo 'WORKDIR /source' >> Dockerfile - - name: OS build - run: | - docker build ./ -t manylinux-amd64 --platform linux/amd64 - docker run \ - -t --rm \ - -v "$GITHUB_WORKSPACE:/source" \ - -v "$GITHUB_WORKSPACE/target/amd64:/source/target" \ - --platform linux/amd64 \ - manylinux-amd64 \ - cargo build --release --all-features; - - name: GNU Create Package - run: .github/scripts/package.sh amd64 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Build (all features) + run: cargo build --release --all-features + - name: Create Package shell: bash + run: | + if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\/v//p') + else + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\///p') + fi + ARTIFACT_PATHNAME="bender-$PKG_VERSION-x86_64-unknown-linux-gnu+slang.tar.gz" + tar -czf "$ARTIFACT_PATHNAME" -C "./target/release" --owner=0 --group=0 bender - name: Upload Release Asset if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.event.release.tag_name }} - files: bender-*.tar.gz + tag_name: ${{ github.event.release.tag_name || github.ref_name }} + files: bender-*-x86_64-unknown-linux-gnu+slang.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - release-gnu_arm64: + + release-linux-modern-arm64: runs-on: ubuntu-24.04-arm - # Use container that supports old GLIBC versions and (hopefully) many linux OSs - # container: quay.io/pypa/manylinux2014_aarch64 steps: - uses: actions/checkout@v6 with: submodules: recursive - - name: Setup Dockerfile - run: | - touch Dockerfile - echo "FROM quay.io/pypa/manylinux2014_aarch64" >> Dockerfile - echo "RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo" >> Dockerfile - echo "RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo" >> Dockerfile - echo "RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo" >> Dockerfile - - echo "RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*" >> Dockerfile - echo "RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*" >> Dockerfile - echo "RUN yum group install "Development Tools" -y && yum clean all" >> Dockerfile - echo 'ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo' >> Dockerfile - echo 'ENV PATH=$CARGO_HOME/bin:$PATH' >> Dockerfile - echo >> Dockerfile - echo 'RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \' >> Dockerfile - echo ' curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \' >> Dockerfile - echo ' chmod -R a=rwX $CARGO_HOME' >> Dockerfile - echo >> Dockerfile - echo 'WORKDIR /source' >> Dockerfile - - name: OS build - run: | - docker build ./ -t manylinux-arm64 --platform linux/arm64 - docker run \ - -t --rm \ - -v "$GITHUB_WORKSPACE:/source" \ - -v "$GITHUB_WORKSPACE/target/arm64:/source/target" \ - --platform linux/arm64 \ - manylinux-arm64 \ - cargo build --release --all-features; - - name: GNU Create Package - run: .github/scripts/package.sh arm64 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Build (all features) + run: cargo build --release --all-features + - name: Create Package shell: bash + run: | + if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\/v//p') + else + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\///p') + fi + ARTIFACT_PATHNAME="bender-$PKG_VERSION-aarch64-unknown-linux-gnu+slang.tar.gz" + tar -czf "$ARTIFACT_PATHNAME" -C "./target/release" --owner=0 --group=0 bender - name: Upload Release Asset if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.event.release.tag_name }} - files: bender-*.tar.gz + tag_name: ${{ github.event.release.tag_name || github.ref_name }} + files: bender-*-aarch64-unknown-linux-gnu+slang.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release-macos: runs-on: macos-latest steps: - uses: actions/checkout@v6 with: submodules: recursive - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://https://sh.rustup.rs | sh -s -- -y --default-toolchain stable - echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable - name: universal2 install run: | rustup target add x86_64-apple-darwin rustup target add aarch64-apple-darwin cargo install universal2 - - name: MacOS Build + - name: Build (all features) run: cargo-universal2 --release --all-features - - name: Get Artifact Name - run: | - if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then \ - PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\/v//p'); \ - else \ - PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\///p'); \ - fi - ARTIFACT_PATHNAME="bender-$PKG_VERSION-universal-apple-darwin.tar.gz" - ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) - echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV - echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV - name: Create Package + shell: bash run: | - gtar -czf $ARTIFACT_PATHNAME -C "./target/universal2-apple-darwin/release" --owner=0 --group=0 bender + if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\/v//p') + else + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\///p') + fi + ARTIFACT_PATHNAME="bender-$PKG_VERSION-universal-apple-darwin+slang.tar.gz" + gtar -czf "$ARTIFACT_PATHNAME" -C "./target/universal2-apple-darwin/release" --owner=0 --group=0 bender - name: Upload Release Asset if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.event.release.tag_name }} - files: bender-*.tar.gz + tag_name: ${{ github.event.release.tag_name || github.ref_name }} + files: bender-*-universal-apple-darwin+slang.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release-windows: runs-on: windows-latest steps: - uses: actions/checkout@v6 with: submodules: recursive - - name: Install Rust - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable with: toolchain: stable - - name: Build + - name: Build (all features) run: cargo build --release --all-features - - name: Get Artifact Name + - name: Create Package shell: bash run: | - if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then \ - PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\/v//p'); \ - else \ - PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\///p'); \ + if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\/v//p') + else + PKG_VERSION=$(echo "$GITHUB_REF" | sed -n 's/^refs\/tags\///p') fi - ARTIFACT_PATHNAME="bender-$PKG_VERSION-x86_64-pc-windows-msvc.tar.gz" - ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) - echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV - echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV - - name: Create Package - run: | + ARTIFACT_PATHNAME="bender-$PKG_VERSION-x86_64-pc-windows-msvc+slang.tar.gz" cp target/release/bender.exe . - & 'C:\Program Files\Git\usr\bin\tar.exe' czf $Env:ARTIFACT_PATHNAME --owner=0 --group=0 bender.exe + tar -czf "$ARTIFACT_PATHNAME" --owner=0 --group=0 bender.exe - name: Upload Release Asset if: ${{ github.event_name == 'release' || inputs.publish_assets }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.event.release.tag_name }} - files: bender-*.tar.gz + tag_name: ${{ github.event.release.tag_name || github.ref_name }} + files: bender-*-x86_64-pc-windows-msvc+slang.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c2e97c837e37c1560a132584319447e881786a90 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 17 Feb 2026 14:51:27 +0100 Subject: [PATCH 10/11] ci: Cache rust builds --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 162d3d95b..63762ebb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust}} + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ci-test-${{ runner.os }}-${{ matrix.rust }} + cache-workspace-crates: "true" - name: Build run: cargo build --all-features - name: Cargo Test @@ -42,6 +46,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ci-test-windows-${{ runner.os }}-stable + cache-workspace-crates: "true" - name: Build run: cargo build --all-features - name: Cargo Test @@ -59,6 +67,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ci-test-macos-${{ runner.os }}-stable + cache-workspace-crates: "true" - name: Build run: cargo build --all-features - name: Cargo Test @@ -84,6 +96,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ci-release-build-${{ runner.os }}-stable + cache-workspace-crates: "true" - name: Build (release) run: cargo build --release --all-features @@ -98,6 +114,10 @@ jobs: with: toolchain: stable components: clippy + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ci-clippy-${{ runner.os }}-stable + cache-workspace-crates: "true" - run: cargo clippy --all-features unused-deps: @@ -108,6 +128,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ci-unused-deps-${{ runner.os }}-stable + cache-workspace-crates: "true" - name: Install machete run: cargo install cargo-machete - name: Check for unused dependencies From edccc1b54083a9bbbcaa35822c684de7ca99a0a6 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Tue, 17 Feb 2026 15:23:29 +0100 Subject: [PATCH 11/11] ci: Cancel ongoing workflows --- .github/workflows/ci.yml | 4 ++++ .github/workflows/cli_regression.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63762ebb1..ae2ea81d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/cli_regression.yml b/.github/workflows/cli_regression.yml index bfdcf9bd7..71b5780a8 100644 --- a/.github/workflows/cli_regression.yml +++ b/.github/workflows/cli_regression.yml @@ -4,6 +4,10 @@ on: pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest