diff --git a/.github/workflows/build-setup.yml b/.github/workflows/build-setup.yml new file mode 100644 index 0000000..fb85852 --- /dev/null +++ b/.github/workflows/build-setup.yml @@ -0,0 +1,26 @@ +- name: Install duckdb + shell: bash + run: | + if ! command -v unzip &> /dev/null; then + apt-get update && apt-get install -y unzip + fi + if [ ! -d "duckdb_lib" ]; then + mkdir duckdb_lib + else + rm -rf duckdb_lib + mkdir duckdb_lib + echo "Directory $dir already exists." + fi + + if [ -f "libduckdb-linux-amd64.zip" ]; then + # File exists, remove it + rm "libduckdb-linux-amd64.zip" + fi + + wget "https://github.com/duckdb/duckdb/releases/download/v1.0.0/libduckdb-linux-amd64.zip" + unzip libduckdb-linux-amd64.zip -d duckdb_lib + cp duckdb_lib/lib*.so* /usr/local/lib/ + ldconfig + rm libduckdb-linux-amd64.zip + echo "$(pwd)/duckdb_lib" + export DUCKDB_LIB_DIR="$(pwd)/duckdb_lib" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a41298a..cd59a60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: # we specify bash to get pipefail; it guards against the `curl` command # failing. otherwise `sh` won't catch that `curl` returned non-0 shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.18.0/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh" - name: Cache cargo-dist uses: actions/upload-artifact@v4 with: @@ -115,6 +115,33 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + - name: "Install duckdb" + run: | + #!/bin/bash + if ! command -v unzip &> /dev/null; then + apt-get update && apt-get install -y unzip + fi + if [ ! -d "duckdb_lib" ]; then + mkdir duckdb_lib + else + rm -rf duckdb_lib + mkdir duckdb_lib + echo "Directory $dir already exists." + fi + + if [ -f "libduckdb-linux-amd64.zip" ]; then + # File exists, remove it + rm "libduckdb-linux-amd64.zip" + fi + + wget "https://github.com/duckdb/duckdb/releases/download/v1.0.0/libduckdb-linux-amd64.zip" + unzip libduckdb-linux-amd64.zip -d duckdb_lib + cp duckdb_lib/lib*.so* /usr/local/lib/ + ldconfig + rm libduckdb-linux-amd64.zip + echo "$(pwd)/duckdb_lib" + DUCKDB_LIB_DIR="$(pwd)/duckdb_lib" cargo build + shell: "bash" - name: Install cargo-dist run: ${{ matrix.install_dist }} # Get the dist-manifest diff --git a/Cargo.toml b/Cargo.toml index a2ea7ee..2fcd540 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,17 +22,20 @@ rustix = "0.38.19" # Config for 'cargo dist' [workspace.metadata.dist] # The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.18.0" +cargo-dist-version = "0.21.0" # CI backends to support ci = "github" # The installers to generate for each app installers = ["shell"] # Target platforms to build apps for (Rust target-triple syntax) targets = ["x86_64-unknown-linux-gnu"] -# Publish jobs to run in CI +# Which actions to run on pull requests pr-run-mode = "plan" # Whether to install an updater program install-updater = true +github-build-setup = "build-setup.yml" +# Path that installers should place binaries in +install-path = "CARGO_HOME" [workspace.metadata.dist.dependencies.apt] musl-tools = '*'