Skip to content

Commit

Permalink
ci: add distribution builds
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardosm committed Apr 7, 2024
1 parent caab9ac commit 8fe5573
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,29 @@ jobs:
run: ./ci/install-rust.sh "${{ matrix.rust-version }}" --profile minimal
- name: Build and test
run: ./ci/build-and-test.sh

build-dist-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Pull image
run: docker pull quay.io/pypa/manylinux2014_x86_64
- name: Build
run: |
docker run \
-v "$(pwd):/workdir" \
-w /workdir \
quay.io/pypa/manylinux2014_x86_64 \
bash ./ci/build-dist-linux.sh
- name: Upload linux-x86_64 artifact
uses: actions/upload-artifact@v4
with:
name: rsjsonnet-linux-x86_64
path: output/rsjsonnet-linux-x86_64
if-no-files-found: error
- name: Upload linux-i686 artifact
uses: actions/upload-artifact@v4
with:
name: rsjsonnet-linux-i686
path: output/rsjsonnet-linux-i686
if-no-files-found: error
29 changes: 29 additions & 0 deletions ci/build-dist-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail

yum install -y glibc-devel.i686

rust_version="$(cat "ci/rust-versions/stable.txt")"

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --default-toolchain "$rust_version" --profile minimal \
-t x86_64-unknown-linux-gnu \
-t i686-unknown-linux-gnu

# shellcheck disable=SC1090
. "$HOME/.cargo/env"

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_CODEGEN_PANIC=abort
export CARGO_PROFILE_RELEASE_STRIP=debuginfo

cargo fetch --locked
mkdir output

cargo build -p rsjsonnet --target x86_64-unknown-linux-gnu --release --frozen
mkdir output/rsjsonnet-linux-x86_64
cp target/x86_64-unknown-linux-gnu/release/rsjsonnet output/rsjsonnet-linux-x86_64/rsjsonnet

cargo build -p rsjsonnet --target i686-unknown-linux-gnu --release --frozen
mkdir output/rsjsonnet-linux-i686
cp target/i686-unknown-linux-gnu/release/rsjsonnet output/rsjsonnet-linux-i686/rsjsonnet

0 comments on commit 8fe5573

Please sign in to comment.