mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 13:01:12 +03:00
rework the build system
- use rustls for reqwest, so we don't need to compile OpenSSL - use better defaults for build arguments in Dockerfile - add Continuous Integration workflow for master branch and it's pull requests - add Release workflow for tags matching SemVer - add release template for automatic release notes generation with GH CLI - remove old and unused assets under .github
This commit is contained in:
parent
1c38c402b9
commit
e21cbd1f63
13 changed files with 462 additions and 810 deletions
48
.github/actions/build/action.yml
vendored
Normal file
48
.github/actions/build/action.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Build project
|
||||
description: Builds the project for specified targets using cargo-zigbuild.
|
||||
|
||||
inputs:
|
||||
targets:
|
||||
description: A comma-separated list of Rust targets.
|
||||
default: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-pc-windows-gnu
|
||||
lint:
|
||||
description: A boolean indicating if linting (cargo-fmt, clippy) should be run
|
||||
default: true
|
||||
test:
|
||||
description: A boolean indicating if tests should be run
|
||||
default: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
||||
- name: Convert input targets to Bash array
|
||||
shell: bash
|
||||
run: |
|
||||
readarray -d $'\0' -t targets < <(awk -F, '{ for (i = 1; i <= NF; i++) printf "--target\0%s\0", $i }' <<< "${{ inputs.targets }}")
|
||||
declare -p targets > /tmp/targets.sh
|
||||
|
||||
- name: Check with cargo-fmt
|
||||
if: inputs.lint == true
|
||||
shell: sh
|
||||
run: cargo fmt -v --all -- --check
|
||||
|
||||
- name: Run Clippy
|
||||
if: inputs.lint == true
|
||||
shell: bash
|
||||
run: |
|
||||
. /tmp/targets.sh
|
||||
cargo-zigbuild clippy -v --all-targets "${targets[@]}" -- -D warnings
|
||||
|
||||
- name: Build with cargo-zigbuild
|
||||
shell: bash
|
||||
run: |
|
||||
. /tmp/targets.sh
|
||||
cargo-zigbuild build -v -r --bin sculptor "${targets[@]}"
|
||||
|
||||
- name: Test with cargo-zigbuild
|
||||
shell: bash
|
||||
if: inputs.test == true
|
||||
run: |
|
||||
. /tmp/targets.sh
|
||||
cargo-zigbuild test -v -r "${targets[@]}"
|
||||
32
.github/actions/dependencies/action.yml
vendored
Normal file
32
.github/actions/dependencies/action.yml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: Install cargo-zigbuild
|
||||
description: Installs cargo-zigbuild and its dependencies
|
||||
|
||||
inputs:
|
||||
zig-version:
|
||||
description: Version of Zig to install
|
||||
default: 0.14.1
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
||||
- name: Install Zig
|
||||
shell: bash
|
||||
run: |
|
||||
ZIG_VERSION="${{ inputs.zig-version }}"
|
||||
[ "$RUNNER_ARCH" == "X64" ] && ZIG_ARCH="x86_64" || ZIG_ARCH="aarch64"
|
||||
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-${ZIG_ARCH}-linux-${ZIG_VERSION}.tar.xz" \
|
||||
-O /tmp/zig.tar.xz
|
||||
|
||||
sudo tar -xJf /tmp/zig.tar.xz -C / \
|
||||
--transform='s|^[^/]+/zig$|usr/local/bin/zig|x' \
|
||||
--transform='s|^[^/]+/lib|usr/local/lib/zig|x' \
|
||||
--transform='s|^[^/]+/doc|usr/local/share/doc/zig|x' \
|
||||
--transform='s|^[^/]+/LICENSE$|usr/local/share/doc/zig/copyright|x' \
|
||||
--transform='s|^[^/]+/README.md$|usr/local/share/doc/zig/README.md|x' \
|
||||
--wildcards \
|
||||
"*/"{zig,lib,doc,LICENSE,README.md}
|
||||
|
||||
- name: Install cargo-zigbuild
|
||||
shell: sh
|
||||
run: cargo install cargo-zigbuild
|
||||
Loading…
Add table
Add a link
Reference in a new issue