Skip to content

Commit

Permalink
updating cargo dist configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tee8z committed Aug 16, 2024
1 parent 31495cb commit c171ddc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-setup.yml
Original file line number Diff line number Diff line change
@@ -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"
29 changes: 28 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '*'
Expand Down

0 comments on commit c171ddc

Please sign in to comment.