Git Winch includes a lightweight build automation capability designed for users who want to perform actions after a successful file push. While originally created for non-technical teams, it also supports technical use-cases like triggering builds for software development or office automation tasks. This system uses a simple `build.bat` file and GNU Make to selectively process updated files after every successful push.
- Ensures repeatable and automatic post-push actions.
- Reduces errors from manual post-processing.
- Helps both technical and non-technical users organize file workflows with minimal effort.
- Ideal for setting up automated build folders or staging areas for server deployment.
This build process runs automatically after a successful push from Git Winch. The `build.bat` file in the repository is triggered and can invoke GNU Make to execute post-push file actions.
Here is the step-by-step setup:
- Download `make.exe` (Windows 32-bit) from https://gnuwin32.sourceforge.net/packages/make.htm
- Place it in `C:\apps\make` (or any preferred location).
- Add this path to your System PATH environment variable so `make` can be used globally.
Decide where you want the processed files to be collected. Example: `D:\Project\gitwinch\build\artifacts`
Your working folder (e.g., `D:\data\lll_officework`) is where files are pushed from Git Winch.
Write a makefile (ASCII format) named, for example, `makefile.lll.txt`. Place it anywhere accessible.
Here’s a working example:
make SRC_DIR ?= D:/data/lll_officework DST_DIR ?= D:/Project/gitwinch/build/artifacts FILES = $(notdir $(wildcard $(SRC_DIR)/*.txt)) TARGETS = $(addprefix $(DST_DIR)/,$(FILES)) all: $(TARGETS) $(DST_DIR)/%.txt: $(SRC_DIR)/%.txt if not exist $(subst /,\\,$(DST_DIR)) mkdir $(subst /,\\,$(DST_DIR)) copy $(subst /,\\,$(SRC_DIR))\$*.txt $(subst /,\\,$(DST_DIR)) /y