feat(ci): Add tasks to build in CI
This commit is contained in:
parent
25a11bb79e
commit
8b70eba79e
2 changed files with 56 additions and 0 deletions
32
.ci/tasks/build.sh
Executable file
32
.ci/tasks/build.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
OUTPUT="$1"
|
||||
|
||||
case "$TARGET" in
|
||||
msvc)
|
||||
cp /src/*.lib ./lib/oodle/
|
||||
cargo build --color always --locked --release --target x86_64-pc-windows-msvc -Zbuild-std
|
||||
|
||||
if [ -d "$OUTPUT" ]; then
|
||||
install -t "$OUTPUT/" target/x86_64-pc-windows-msvc/release/dtmt.exe
|
||||
install -t "$OUTPUT/" target/x86_64-pc-windows-msvc/release/dtmm.exe
|
||||
fi
|
||||
|
||||
;;
|
||||
linux)
|
||||
cp /src/*.so ./lib/oodle/
|
||||
cargo build --color always --locked --profile release-lto
|
||||
|
||||
if [ -d "$OUTPUT" ]; then
|
||||
install -t "$OUTPUT/" target/release/dtmt
|
||||
install -t "$OUTPUT/" target/release/dtmm
|
||||
fi
|
||||
|
||||
;;
|
||||
*)
|
||||
set +x
|
||||
echo "Env var 'TARGET' must either be 'msvc' or 'linux'. Got '$TARGET'." >&2
|
||||
exit 1
|
||||
esac
|
24
.ci/tasks/build.yml
Normal file
24
.ci/tasks/build.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
platform: linux
|
||||
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: registry.local:5000/dtmt-ci-base-((target))
|
||||
tag: latest
|
||||
|
||||
inputs:
|
||||
- name: repo
|
||||
|
||||
outputs:
|
||||
- name: artifact
|
||||
|
||||
params:
|
||||
CI: true
|
||||
TARGET: ((target))
|
||||
|
||||
run:
|
||||
path: .ci/tasks/build.sh
|
||||
dir: repo
|
||||
args:
|
||||
- /artifact
|
Loading…
Add table
Reference in a new issue