21a20ce7ca
Refactor the Gitea release workflow to introduce a dedicated `create-release` job that exposes a shared release ID, eliminating redundant inline creation. Update the Makefile to automatically generate annotated tags with AI-derived markdown release notes from recent commits. Add an optional `numa` feature to `obikindex` that gates `hwlocality` behind conditional compilation, providing a graceful UMA fallback when disabled. Bump `obikmer` to v1.1.17.
98 lines
3.4 KiB
Makefile
98 lines
3.4 KiB
Makefile
VENV := .venv
|
|
PYTHON := $(VENV)/bin/python
|
|
PIP := $(VENV)/bin/pip
|
|
MKDOCS := $(VENV)/bin/mkdocs
|
|
|
|
CARGO_DIR := src
|
|
|
|
DOC_DIR := docmd
|
|
DOC_FILE := mkdocs.yml
|
|
DOC_SITE := doc
|
|
DOC_PORT := 8001
|
|
|
|
# ── virtualenv ────────────────────────────────────────────────────────────────
|
|
|
|
$(VENV)/bin/activate:
|
|
python3 -m venv $(VENV)
|
|
|
|
$(MKDOCS): $(VENV)/bin/activate
|
|
$(PIP) install --quiet --upgrade pip
|
|
$(PIP) install --quiet \
|
|
livereload watchdog \
|
|
mkdocs mkdocs-material \
|
|
mkdocs-mermaid2-plugin \
|
|
mkdocs-bibtex
|
|
$(PIP) install --quiet --upgrade InSilicoSeq
|
|
|
|
# ── obikmer binary ───────────────────────────────────────────────────────────
|
|
|
|
PROFILE_FILE := profile.pb
|
|
PPROF_PORT := 8081
|
|
|
|
.PHONY: obikmer
|
|
obikmer:
|
|
cargo build --release --manifest-path $(CARGO_DIR)/Cargo.toml --bin obikmer
|
|
|
|
.PHONY: debug
|
|
debug:
|
|
cargo build --manifest-path $(CARGO_DIR)/Cargo.toml --bin obikmer
|
|
|
|
.PHONY: profile-build
|
|
profile-build:
|
|
cargo build --release --manifest-path $(CARGO_DIR)/Cargo.toml \
|
|
--bin obikmer --features obikmer/profiling
|
|
|
|
.PHONY: profile-view
|
|
profile-view:
|
|
go tool pprof -http=127.0.0.1:$(PPROF_PORT) $(PROFILE_FILE)
|
|
# ── documentation ─────────────────────────────────────────────────────────────
|
|
|
|
.PHONY: doc
|
|
doc: $(MKDOCS)
|
|
$(MKDOCS) build -f $(DOC_FILE)
|
|
|
|
.PHONY: doc-serve
|
|
doc-serve: $(MKDOCS)
|
|
$(MKDOCS) serve -f $(DOC_FILE) \
|
|
--dev-addr=127.0.0.1:$(DOC_PORT) \
|
|
--livereload
|
|
.PHONY: clean-doc
|
|
clean-doc:
|
|
rm -rf $(DOC_SITE)/
|
|
|
|
.PHONY: clean
|
|
clean: clean-doc
|
|
rm -rf $(VENV)
|
|
|
|
# ── release ───────────────────────────────────────────────────────────────────
|
|
|
|
CARGO_TOML := $(CARGO_DIR)/obikmer/Cargo.toml
|
|
|
|
.PHONY: bump-version
|
|
bump-version:
|
|
@current=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
|
if [ -n "$(RELEASE)" ]; then \
|
|
new_version="$(RELEASE)"; \
|
|
else \
|
|
major=$$(echo $$current | cut -d. -f1); \
|
|
minor=$$(echo $$current | cut -d. -f2); \
|
|
patch=$$(echo $$current | cut -d. -f3); \
|
|
new_patch=$$((patch + 1)); \
|
|
new_version="$$major.$$minor.$$new_patch"; \
|
|
fi; \
|
|
echo "Version: $$current -> $$new_version"; \
|
|
sed -i.bak "s/^version = \"$$current\"/version = \"$$new_version\"/" $(CARGO_TOML) && \
|
|
rm $(CARGO_TOML).bak
|
|
|
|
.PHONY: release
|
|
release: bump-version
|
|
@jj auto-describe
|
|
@jj git push --change @
|
|
@new_version=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
|
git_hash=$$(jj log -r @ --no-graph -T 'commit_id'); \
|
|
commits=$$(jj log -r 'latest(tags())..@' --no-graph -T 'description ++ "\n"' 2>/dev/null || \
|
|
jj log --no-graph -T 'description ++ "\n"' --limit 30); \
|
|
notes=$$(printf 'Write concise markdown release notes for obikmer (a Rust kmer genomics tool). Be technical and direct. Base them strictly on these commit messages:\n\n%s' "$$commits" | aichat); \
|
|
git tag -a "v$$new_version" -m "$$notes" "$$git_hash" && \
|
|
git push origin "v$$new_version"
|