-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
147 lines (115 loc) · 3.53 KB
/
Copy pathjustfile
File metadata and controls
147 lines (115 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
[private]
default: help
# Load the environment variables defined in the `.env` file.
set dotenv-load
# Set default options for Robot Framework if not already set by environment
export ROBOT_OPTIONS := env("ROBOT_OPTIONS", "-d results")
#
# Miscellaneous recipes
#
# Print the available recipes
[group("misc")]
help:
@just --justfile {{ justfile() }} --list
# Upgrade all project dependencies
[group("misc")]
upgrade-all: upgrade-toolchain upgrade-python-dependencies upgrade-rust-dependencies prek-hooks-update gha_update
# Prepare a new release (calculate version, create branch, update changelog and manifests)
[group("misc")]
prepare-release:
#!/usr/bin/env bash
set -euo pipefail
# 1. Compute the next version number using git-cliff bump calculation
VERSION=$(git-cliff --bump --unreleased | grep -m1 "## \[" | sed -E 's/## \[(.*)\].*/\1/')
echo "Preparing release v${VERSION}..."
# 2. Switch to a dedicated release branch, creating it if it doesn't exist
TARGET_BRANCH="chore/release-v${VERSION}"
if [ "$(git branch --show-current)" != "${TARGET_BRANCH}" ]; then
git switch -c "${TARGET_BRANCH}" || git switch "${TARGET_BRANCH}"
fi
# 3. Generate and prepend the new changelog section to CHANGELOG.md
git-cliff --tag v${VERSION} --unreleased --prepend CHANGELOG.md
# 4. Bump the Python package version statically in pyproject.toml
uv version "${VERSION}" --frozen
# 5. Bump the Rust crate version in Cargo.toml
sed -i 's/^version = "[0-9.]*"/version = "'"${VERSION}"'"/' Cargo.toml
# 6. Run formatting and validation checks to ensure clean updates (non-blocking)
just prek || true
# 7. Display complete status and post-merge publishing instructions
echo "Release preparation complete. Review changes, commit, and push the branch."
echo ""
echo "Commit message suggestion: chore: release v${VERSION}"
echo ""
echo "Once the PR is merged, run the following commands to tag and trigger the release pipeline:"
echo " git checkout main"
echo " git pull"
echo " git tag v${VERSION}"
echo " git push origin v${VERSION}"
#
# Development recipes
#
# Build the Docker image of the devcontainer (for debug purposes)
[group("dev")]
devcontainer-build:
docker build -f ./.devcontainer/Dockerfile .
# Upgrade the tools used in the project
[group("dev")]
upgrade-toolchain:
mise upgrade
mise lock
# Build the Python extension module using Maturin and uv
[group("dev")]
build:
uv run maturin develop
# Upgrade Python dependencies
[group("dev")]
upgrade-python-dependencies:
uv lock --upgrade
# Upgrade Rust dependencies
[group("dev")]
upgrade-rust-dependencies:
cargo cooldown update
#
# Static analysis recipes
#
# Execute the pre-commit hooks using prek
[group("static analysis")]
prek:
prek run --all-files
# Update the pre-commit hooks
[group("static analysis")]
prek-hooks-update:
prek auto-update
#
# CI/CD recipes
#
# Pin the GitHub Actions hash
[group("ci/cd")]
gha_pin:
pinact run
# Update the GitHub Actions
[group("ci/cd")]
gha_update:
pinact run -update
#
# Tests recipes
#
# Run the Rust internal unit tests
[group("test")]
unit-test:
cargo test
# Run the Robot Framework acceptance tests
[group("test")]
acceptance-test: build
uv run robot tests/
#
# Documentation recipes
#
# Build the documentation site
[group("docs")]
docs-build:
uvx --with mkdocstrings-python zensical build --clean
# Serve the documentation site locally
[group("docs")]
docs-serve:
uvx --with mkdocstrings-python zensical serve