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 71a20f2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,32 @@ jobs:
run: ./ci/install-rust.sh "${{ matrix.rust-version }}" --profile minimal
- name: Build and test
run: ./ci/build-and-test.sh

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

target="$1"

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

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --default-toolchain "${rustup_args[@]}" -t "$target"

. "$HOME/.cargo/env"

cargo fetch --locked
cargo build -p rsjsonnet --target "$target" --release --frozen

0 comments on commit 71a20f2

Please sign in to comment.