-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
68 lines (57 loc) · 1.75 KB
/
justfile
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
#!/usr/bin/just
docs: get-deps-book
#!/usr/bin/env bash
set -euxo pipefail
PATH="${PATH}:${PWD}/mdbook-deps/bin"
export PATH
pushd docs
mdbook-mermaid install
mdbook-catppuccin install
mdbook build
popd
git config --global init.defaultBranch main
git config --global user.name "${CI_REPO_OWNER}"
git config --global user.email "${MAIL}"
pushd ../
mkdir -p docs/
pushd docs
git init
git remote add origin "https://${RYPPER_ACCESS_TOKEN}@codeberg.org/${CI_REPO}.git"
git switch --orphan pages
cp ../${CI_REPO_NAME}/.domains .domains
if [ -n "${CI_COMMIT_TAG:-}" ]; then
cp -rfv ../${CI_REPO_NAME}/docs/book/* .
cp -rfv ../${CI_REPO_NAME}/docs/book stable
git add -A
git commit -m "update book for ${CI_COMMIT_TAG:-}"
fi
cp -rfv ../${CI_REPO_NAME}/docs/book dev
git add -A
git commit -m "update book for commit ${CI_COMMIT_SHA}"
git push --force -u origin pages
popd
get-deps:
zypper --non-interactive install gcc gcc-c++ libnettle-devel libzstd-devel libopenssl-devel clang-devel rustup
rustup install nightly
get-deps-book:
zypper --non-interactive install mdbook git rustup
rustup install nightly
mkdir -p mdbook-deps/bin
cargo install --git "https://github.com/catppuccin/mdBook" --root mdbook-deps
cargo install mdbook-mermaid --root mdbook-deps
build:
cargo build
test:
cargo test
build-release:
cargo build --release --all-features
test-release:
cargo test --release --all-features
install: get-deps build-release
cargo install --path .
publish:
cargo publish --token "${CARGO_REGISTRY_TOKEN}"
format:
cargo fmt
# Ignore install section
do-all: get-deps build-release test docs publish