Merge branch 'ci-testing'
Some checks failed
/ verify (push) Waiting to run
/ publish (push) Has been cancelled

This commit is contained in:
Juno Takano 2026-03-08 01:19:44 -03:00
commit c32ccc69c9
10 changed files with 64 additions and 14 deletions

View file

@ -27,32 +27,34 @@ jobs:
- name: Setup additional tooling
run: .forgejo/workflows/setup-tools.sh
- name: Run all assessments
run: just verify
- name: Build x64 glibc release binary
run: just full-build x86_64-unknown-linux-gnu
run: just release-build x86_64-unknown-linux-gnu
- name: Build x64 musl release binary
run: just full-build x86_64-unknown-linux-musl
run: just release-build x86_64-unknown-linux-musl
- name: Calculate SHA-256 hashes
run: just shasum
- name: Publish x64 glibc binary to git.jutty.dev registry
run: |
version=$(./target/x86_64-unknown-linux-gnu/en --version)
version=$(./target/x86_64-unknown-linux-gnu/release/en --version)
api_root=https://git.jutty.dev/api
url=$api_root/packages/jutty/generic/en/$version/en-x64-linux-gnu
curl -fsSL \
--user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \
--upload-file target/x86_64-unknown-linux-gnu/en $url
--upload-file target/x86_64-unknown-linux-gnu/release/en $url
- name: Publish x64 musl binary to git.jutty.dev registry
run: |
version=$(./target/x86_64-unknown-linux-musl/en --version)
version=$(./target/x86_64-unknown-linux-musl/release/en --version)
api_root=https://git.jutty.dev/api
url=$api_root/packages/jutty/generic/en/$version/en-x64-linux-musl
curl -fsSL \
--user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \
--upload-file target/x86_64-unknown-linux-musl/en $url
--upload-file target/x86_64-unknown-linux-musl/release/en $url

View file

@ -28,6 +28,8 @@ jobs:
run: |
rustup component add llvm-tools-preview
rustup component add --toolchain nightly rustfmt clippy
rustup target add x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl
- name: Setup additional tooling
run: .forgejo/workflows/setup-tools.sh

View file

@ -260,7 +260,7 @@ verify:
git status
exit 1
fi
{{ just_cmd }} update version-assess \
{{ just_cmd }} version-assess \
security-assess format-assess lint-assess check test cover-assess
alias v := verify
@ -299,23 +299,31 @@ alias cl := clean
# Build project with Cargo
[group: 'build']
build target=default_target: update
build target=default_target:
cargo build --target {{ target }} --locked
alias b := build
# Release build
[group: 'build']
release-build target=default_target: update verify
release-build target=default_target:
cargo build --target {{ target }} --locked --release
alias rb := release-build
# Clean, run assessments, release build
# glibc release build
[group: 'build']
full-build target: clean (release-build target)
release-build-gnu:
cargo build --target {{ glibc_target }} --locked --release
alias fb := full-build
alias rbg := release-build-gnu
# musl release build
[group: 'build']
release-build-musl:
cargo build --target {{ musl_target }} --locked --release
alias rbm := release-build-musl
# Calculate SHA 256 hashes for release binaries
[group: 'build']
@ -337,7 +345,10 @@ alias ch := choose
export CARGO_TERM_COLOR := 'always'
default_target := "x86_64-unknown-linux-gnu"
musl_target := "x86_64-unknown-linux-musl"
glibc_target := "x86_64-unknown-linux-gnu"
default_target := musl_target
debug_vars := 'DEBUG=${DEBUG:-} DEBUG_FILTER=${DEBUG_FILTER:-} RUST_BACKTRACE=${RUST_BACKTRACE:-} RUSTFLAGS=${RUSTFLAGS:-}'
watch_cmd := "watchexec -qc -r -e rs,toml,html --color always -- "
cover_cmd := 'cargo llvm-cov --color always --ignore-filename-regex "main\.rs|log\.rs"'

23
containers/build.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env sh
set -eu
suffix=$(printf '%s' "$1" | sed 's/.*\.//')
tag="en:$suffix"
if podman container exists "$tag"; then
podman stop --time 3 "$tag"
fi
if [ "$suffix" = 'debian-dev' ]; then
cp -v ../target/x86_64-unknown-linux-gnu/release/en en
elif [ "$suffix" = 'alpine-dev' ]; then
cp -v ../target/x86_64-unknown-linux-musl/release/en en
fi
podman build \
--tag "$tag" \
-f "Containerfile.$suffix"
if [ -f en ]; then
rm -v en
fi

12
containers/run.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -eu
suffix=$(printf '%s' "$1" | sed 's/.*\.//')
name="en-$suffix"
tag="en:$suffix"
podman run \
--replace \
--name "$name" \
--publish 3008:80 \
"$tag"