Add release folder rule
This commit is contained in:
parent
b6961cd93e
commit
0eab785793
57
Makefile.am
57
Makefile.am
@ -1,5 +1,14 @@
|
|||||||
SUBDIRS = src
|
SUBDIRS = src
|
||||||
|
|
||||||
|
# ===========================
|
||||||
|
# Caminhos e artefactos
|
||||||
|
# ===========================
|
||||||
|
TOP_DIR = $(shell pwd)
|
||||||
|
DIST_DIR = $(TOP_DIR)/dist
|
||||||
|
BUILD_DIR = $(TOP_DIR)/build
|
||||||
|
GIT_VER = $(shell git describe --tags --always --dirty 2>/dev/null || echo "0.1-dev")
|
||||||
|
SRC_TAR = $(DIST_DIR)/neoricalex-$(GIT_VER)-src.tar.gz
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# Configurações de Git
|
# Configurações de Git
|
||||||
# ===========================
|
# ===========================
|
||||||
@ -9,13 +18,6 @@ GIT_REMOTE ?= "origin"
|
|||||||
GIT_BRANCH ?= "main"
|
GIT_BRANCH ?= "main"
|
||||||
COMMIT_MSG ?= "Auto-commit via make git"
|
COMMIT_MSG ?= "Auto-commit via make git"
|
||||||
|
|
||||||
# ===========================
|
|
||||||
# Caminhos e artefactos
|
|
||||||
# ===========================
|
|
||||||
DIST_DIR ?= $(top_builddir)/dist
|
|
||||||
BUILD_DIR ?= $(top_builddir)/build
|
|
||||||
SRC_TAR ?= $(DIST_DIR)/neoricalex-src.tar.gz
|
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# Alvos principais
|
# Alvos principais
|
||||||
# ===========================
|
# ===========================
|
||||||
@ -24,7 +26,7 @@ SRC_TAR ?= $(DIST_DIR)/neoricalex-src.tar.gz
|
|||||||
all: $(DIST_DIR)
|
all: $(DIST_DIR)
|
||||||
|
|
||||||
$(DIST_DIR):
|
$(DIST_DIR):
|
||||||
mkdir -p $(DIST_DIR)
|
@mkdir -p $(DIST_DIR)
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# Empacotamento do código-fonte
|
# Empacotamento do código-fonte
|
||||||
@ -32,9 +34,9 @@ $(DIST_DIR):
|
|||||||
tarball: $(SRC_TAR)
|
tarball: $(SRC_TAR)
|
||||||
|
|
||||||
$(SRC_TAR):
|
$(SRC_TAR):
|
||||||
@echo "[TAR] Empacotando código-fonte..."
|
@echo "[TAR] Empacotando código-fonte (versão $(GIT_VER))..."
|
||||||
mkdir -p $(DIST_DIR)
|
@mkdir -p "$(DIST_DIR)" "$(BUILD_DIR)"
|
||||||
cd $(top_srcdir) && tar \
|
cd "$(TOP_DIR)" && tar \
|
||||||
--exclude="$(notdir $(SRC_TAR))" \
|
--exclude="$(notdir $(SRC_TAR))" \
|
||||||
--exclude="$(DIST_DIR)" \
|
--exclude="$(DIST_DIR)" \
|
||||||
--exclude="$(BUILD_DIR)" \
|
--exclude="$(BUILD_DIR)" \
|
||||||
@ -46,7 +48,7 @@ $(SRC_TAR):
|
|||||||
--exclude='*.o' \
|
--exclude='*.o' \
|
||||||
--exclude='*.a' \
|
--exclude='*.a' \
|
||||||
--exclude='*.so' \
|
--exclude='*.so' \
|
||||||
-czf $(SRC_TAR) .
|
-czf "$(SRC_TAR)" .
|
||||||
@echo "[✔] Tarball gerado em $(SRC_TAR)"
|
@echo "[✔] Tarball gerado em $(SRC_TAR)"
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
@ -58,27 +60,27 @@ git: check-remote
|
|||||||
@git config user.email $(GIT_EMAIL)
|
@git config user.email $(GIT_EMAIL)
|
||||||
@git rev-parse --abbrev-ref HEAD >/dev/null 2>&1 || true
|
@git rev-parse --abbrev-ref HEAD >/dev/null 2>&1 || true
|
||||||
@git add -A
|
@git add -A
|
||||||
@git commit -m "$$(echo "$(COMMIT_MSG)")" || echo "Nenhuma modificação para commitar."
|
@git commit -m "$(COMMIT_MSG)" || echo "Nenhuma modificação para commitar."
|
||||||
@git push $(GIT_REMOTE) $(GIT_BRANCH)
|
@git push $(GIT_REMOTE) $(GIT_BRANCH)
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# Release (Tarball)
|
# Release (Tarball + Tag)
|
||||||
# ===========================
|
# ===========================
|
||||||
release: tarball check-remote
|
release: tarball check-remote
|
||||||
@echo "🚀 Publicando build em dist/releases"
|
@echo "🚀 Publicando build em dist/releases (versão: $(GIT_VER))"
|
||||||
@mkdir -p $(DIST_DIR)/releases
|
@mkdir -p $(DIST_DIR)/releases
|
||||||
@if ls $(DIST_DIR)/neoricalex-*.tar.gz >/dev/null 2>&1; then \
|
@cp $(SRC_TAR) $(DIST_DIR)/releases/ 2>/dev/null || echo "⚠️ Nenhum tarball encontrado. Execute 'make tarball' primeiro."
|
||||||
cp $(DIST_DIR)/neoricalex-*.tar.gz $(DIST_DIR)/releases/; \
|
|
||||||
else \
|
|
||||||
echo "⚠️ Nenhum tarball encontrado. Execute 'make tarball' primeiro."; \
|
|
||||||
fi
|
|
||||||
@git add $(DIST_DIR)/releases/
|
@git add $(DIST_DIR)/releases/
|
||||||
@git commit -m "Build automático: release $(shell date +%F_%H-%M)" || echo "Nenhum ficheiro novo para commitar."
|
@git commit -m "Build automático: release $(GIT_VER)" || echo "Nenhum ficheiro novo para commitar."
|
||||||
@git push origin main
|
@git push origin main
|
||||||
@TAG="v$(shell date +%Y.%m.%d-%H%M)" && \
|
@TAG="$(GIT_VER)"; \
|
||||||
echo "🏷 Criando tag $$TAG" && \
|
if git rev-parse "$$TAG" >/dev/null 2>&1; then \
|
||||||
git tag -a $$TAG -m "Release automática em $$TAG" && \
|
echo "⚠️ Tag $$TAG já existente."; \
|
||||||
git push origin $$TAG || echo "⚠️ Tag já existente ou erro ao criar."
|
else \
|
||||||
|
echo "🏷 Criando tag $$TAG"; \
|
||||||
|
git tag -a "$$TAG" -m "Release automática $$TAG"; \
|
||||||
|
git push origin "$$TAG"; \
|
||||||
|
fi
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# Git Remote (HTTPS → SSH Auto-Fix)
|
# Git Remote (HTTPS → SSH Auto-Fix)
|
||||||
@ -106,7 +108,6 @@ check-remote:
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# Teste
|
# Teste
|
||||||
# ===========================
|
# ===========================
|
||||||
@ -118,6 +119,6 @@ run:
|
|||||||
# ===========================
|
# ===========================
|
||||||
clean-local:
|
clean-local:
|
||||||
@echo "[CLEAN] Removendo diretórios temporários..."
|
@echo "[CLEAN] Removendo diretórios temporários..."
|
||||||
rm -rf $(BUILD_DIR)
|
@rm -rf $(BUILD_DIR)
|
||||||
find $(DIST_DIR) -type f ! -path "$(DIST_DIR)/releases/*" -delete
|
@find $(DIST_DIR) -maxdepth 1 -type f ! -path "$(DIST_DIR)/releases/*" -delete 2>/dev/null || true
|
||||||
@echo "[✔] Limpeza concluída (releases preservadas)"
|
@echo "[✔] Limpeza concluída (releases preservadas)"
|
||||||
|
|||||||
35
configure.ac
35
configure.ac
@ -1,16 +1,37 @@
|
|||||||
AC_INIT([NEORICALEX], [0.1], [https://gitea.neoricalex.com/neo/neoricalex.git])
|
AC_INIT([NEORICALEX], [NEO_VERSION], [https://gitea.neoricalex.com/neo/neoricalex.git])
|
||||||
|
|
||||||
|
# ===========================
|
||||||
|
# Diretórios base
|
||||||
|
# ===========================
|
||||||
|
AC_CONFIG_AUX_DIR([.])
|
||||||
|
AC_SUBST([TOP_DIR], ['$(CURDIR)'])
|
||||||
|
AC_SUBST([BUILD_DIR], ['$(CURDIR)/build'])
|
||||||
|
AC_SUBST([DIST_DIR], ['$(CURDIR)/dist'])
|
||||||
|
|
||||||
|
# ===========================
|
||||||
|
# Versão dinâmica (Git)
|
||||||
|
# ===========================
|
||||||
|
m4_define([NEO_VERSION],
|
||||||
|
m4_esyscmd_s([git describe --tags --always --dirty 2>/dev/null || echo "0.1-dev"]))
|
||||||
|
AC_SUBST([NEO_VERSION])
|
||||||
|
|
||||||
|
# Caminho do tarball dinâmico (protegido contra M4 expansion)
|
||||||
|
AC_SUBST([SRC_TAR],
|
||||||
|
['$(CURDIR)/dist/neoricalex-@NEO_VERSION@-src.tar.gz'])
|
||||||
|
|
||||||
|
# ===========================
|
||||||
|
# Automake + Python
|
||||||
|
# ===========================
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
|
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
|
||||||
AM_PATH_PYTHON([3.0])
|
AM_PATH_PYTHON([3.0])
|
||||||
|
|
||||||
# Diretórios base
|
# ===========================
|
||||||
AC_SUBST([BUILD_DIR], [${abs_top_builddir}/build])
|
# Arquivos Makefile
|
||||||
AC_SUBST([DIST_DIR], [${abs_top_builddir}/dist])
|
# ===========================
|
||||||
AC_SUBST([SRC_TAR], [${abs_top_builddir}/dist/neoricalex-${PACKAGE_VERSION}-src.tar.gz])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
src/Makefile
|
src/Makefile
|
||||||
src/manager/Makefile
|
src/manager/Makefile
|
||||||
])
|
])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|||||||
BIN
dist/releases/neoricalex-b6961cd-dirty-src.tar.gz
vendored
Normal file
BIN
dist/releases/neoricalex-b6961cd-dirty-src.tar.gz
vendored
Normal file
Binary file not shown.
@ -4,11 +4,15 @@ bin_SCRIPTS = neoricalex
|
|||||||
CLEANFILES = $(bin_SCRIPTS)
|
CLEANFILES = $(bin_SCRIPTS)
|
||||||
EXTRA_DIST = neoricalex.in
|
EXTRA_DIST = neoricalex.in
|
||||||
|
|
||||||
do_substitution = sed -e 's,[@]pythondir[@],$(pythondir),g' \
|
# ===========================
|
||||||
-e 's,[@]PACKAGE[@],$(PACKAGE),g' \
|
# Substituição dinâmica
|
||||||
-e 's,[@]VERSION[@],$(VERSION),g'
|
# ===========================
|
||||||
|
|
||||||
neoricalex: neoricalex.in Makefile
|
neoricalex: neoricalex.in Makefile
|
||||||
@which git >/dev/null || { echo "⚠️ Git não encontrado — instale-o manualmente."; exit 1; }
|
@which git >/dev/null || { echo "⚠️ Git não encontrado — instale-o manualmente."; exit 1; }
|
||||||
$(do_substitution) < $(srcdir)/neoricalex.in > neoricalex
|
sed \
|
||||||
|
-e 's,[@]pythondir[@],$(pythondir),g' \
|
||||||
|
-e 's,[@]PACKAGE[@],$(PACKAGE),g' \
|
||||||
|
-e 's,[@]VERSION[@],$(VERSION),g' \
|
||||||
|
< $(srcdir)/neoricalex.in > neoricalex
|
||||||
chmod +x neoricalex
|
chmod +x neoricalex
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,19 @@
|
|||||||
# Python sources
|
# ===========================
|
||||||
neoricalex_PYTHON = \
|
# Módulos Python do Manager
|
||||||
|
# ===========================
|
||||||
|
|
||||||
|
# Diretório de instalação Python
|
||||||
|
neoricalexdir = $(pythondir)
|
||||||
|
|
||||||
|
# Fontes do manager
|
||||||
|
dist_neoricalex_PYTHON = \
|
||||||
manager_main.py \
|
manager_main.py \
|
||||||
manifest_parser.py \
|
manifest_parser.py \
|
||||||
module_loader.py \
|
module_loader.py \
|
||||||
tui_manager.py \
|
tui_manager.py \
|
||||||
__init__.py \
|
__init__.py
|
||||||
../bootstrap.py
|
|
||||||
|
# Inclui o bootstrap (nível acima) como parte deste pacote
|
||||||
|
EXTRA_DIST = ../bootstrap.py
|
||||||
|
|
||||||
neoricalexdir = $(pythondir)
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,6 @@ sys.path.insert(1, '/usr/local/local/lib/python3.12/dist-packages')
|
|||||||
from bootstrap import Application
|
from bootstrap import Application
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = Application(package="neoricalex", version="0.1")
|
app = Application(package="neoricalex", version="b6961cd-dirty")
|
||||||
app.run()
|
app.run()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user