Add 'latest' tag generation, update SourceBuild docs
Some checks are pending
/ verify (push) Waiting to run

This commit is contained in:
Juno Takano 2026-03-07 01:21:59 -03:00
commit df2133f542
2 changed files with 42 additions and 28 deletions

View file

@ -136,22 +136,23 @@ alias oo := cover-open
# Tag HEAD with version from Cargo.toml
[script, group: 'assess']
tag: update && version-assess
last_tag=$(git describe --tags --abbrev=0 \
$(git rev-list --tags --max-count=1) | tr -d v)
manifest_version=$(grep '^version' Cargo.toml | cut -d \" -f 2)
lockfile_version=$(grep -A 1 'name = "en"' Cargo.lock |
grep version | cut -d '"' -f 2)
if [ "$last_tag" = "$manifest_version" ]; then
echo "Last tag $last_tag and manifest ($manifest_version) already match"
exit 1
elif [ "$manifest_version" != "$lockfile_version" ]; then
tag: update
if [ "{{ last_tag }}" = "{{ manifest_version }}" ]; then
echo "Last tag {{ last_tag }} and manifest ({{ manifest_version }}) already match"
if [ "{{ last_tag }}" != "{{ tagged_latest }}" ]; then
echo "Last tag {{ last_tag }} and 'latest' tag ({{ tagged_latest }}) diverge"
git tag latest "v{{ manifest_version }}"
{{ just_cmd }} version-assess
fi
exit
elif [ "{{ manifest_version }}" != "{{ lockfile_version }}" ]; then
echo "Manifest and lockfile versions don't match: update failed?"
exit 1
fi
git tag "v$manifest_version" HEAD
git tag "v{{ manifest_version }}" HEAD
git tag latest "v{{ manifest_version }}"
{{ just_cmd }} version-assess
# Verify and push
[group: 'develop']
@ -267,17 +268,16 @@ alias v := verify
# Check tag-manifest consistency
[script, group: 'assess']
version-assess: update
last_tag=$(git describe --tags --abbrev=0 \
$(git rev-list --tags --max-count=1) | tr -d v)
manifest_version=$(grep '^version' Cargo.toml | cut -d \" -f 2)
lockfile_version=$(grep -A 1 'name = "en"' Cargo.lock |
grep version | cut -d '"' -f 2)
if
[ "$last_tag" != "$manifest_version" ] ||
[ "$last_tag" != "$lockfile_version" ]
[ "{{ last_tag }}" != "{{ tagged_latest }}" ] \
|| [ "{{ last_tag }}" != "{{ lockfile_version }}" ] \
|| [ "{{ last_tag }}" != "{{ lockfile_version }}" ]
then
printf 'Last tag: %s\nManifest: %s\nLockfile: %s\n' \
"$last_tag" "$manifest_version" "$lockfile_version"
printf 'Last tag: %s\nManifest: %s\nLockfile: %s\nTagged latest: %s\n' \
"{{ last_tag }}" \
"{{ manifest_version }}" \
"{{ lockfile_version }}" \
"{{ tagged_latest }}"
exit 1
fi
@ -349,4 +349,16 @@ 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"'
just_cmd := 'just --timestamp --explain --command-color green'
last_tag := ```
git tag --sort=-creatordate \
| grep -v '^latest$' | head -1 | tr -d v
```
tagged_latest := `git tag --points-at $(git rev-parse latest) \
| grep -v '^latest$' | tr -d v`
manifest_version := `grep "^version" Cargo.toml | cut -d \" -f 2`
lockfile_version := ```
grep -A 1 'name = "en"' Cargo.lock \
| grep version | cut -d '"' -f 2
```
set unstable

View file

@ -18,8 +18,8 @@ If you are on another platform or simply paranoid, you can also build en yoursel
You will need:
- For compiling en, a |Rust toolchain|https://rustup.rs/
- For compiling dependencies, a C toolchain
- For en itself, a |Rust compiler|https://rustup.rs/
- For dependencies, a C compiler (e.g. `gcc`)
Given the above is satisfied, you can build directly through Cargo:
@ -29,7 +29,7 @@ cargo install --git https://codeberg.org/jutty/en
And you should now have the `en` command available on your shell.
For more information on building from source, see |SourceBuild|.
For more details on building from source, see |SourceBuild|.
## Usage
@ -106,7 +106,7 @@ hidden = true
[nodes.SourceBuild]
text = """
Building from source is briefly described in the |Documentation| page.
An overview on building from source is available in the |Documentation| page. This page contains a more detailed and considered approach for those interested.
Source builds are tested on both Debian and Alpine, meaning en should compile and run on both glibc and musl systems.
@ -114,7 +114,9 @@ Source builds are tested on both Debian and Alpine, meaning en should compile an
A Rust toolchain is required to build en itself and can be installed through |rustup|https://rustup.rs/|.
For compiling en dependencies, you will need a C compiler and a libc (e.g. `gcc` + `glibc` or `clang` + `musl`), which may already be installed on your system
For compiling en dependencies, you will also need a C toolchain: a compiler and a libc (e.g. `gcc` + `glibc` or `clang` + `musl`), which may already be installed on your system.
For the two tested systems, all you need are the following packages:
%
Distribution ! Needed packages
@ -122,11 +124,11 @@ For compiling en dependencies, you will need a C compiler and a libc (e.g. `gcc`
*Alpine* | `clang`
%
You may also need `curl` or `git` depending on how you will fetch sources.
You may also need `curl`, `git` and `ca-certificates` depending on how you will fetch the source code.
## Building from a Git clone
Aside from the `cargo install` approach described in |Documentation|, ou can alternatively fetch the code yourself first using Git:
Aside from the `cargo install` approach described in |Documentation|, ou can alternatively fetch the code yourself using Git, which allows you to inspect and change it before compiling:
`
git clone https://codeberg.org/jutty/en