diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbd9d77..8b5386e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,17 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Build admin UI + run: | + git clone --depth 1 https://github.com/GoCodeAlone/workflow.git /tmp/workflow-ui-build + cd /tmp/workflow-ui-build/ui && npm ci && npx vite build + rm -rf internal/ui_dist && cp -r /tmp/workflow-ui-build/ui/dist internal/ui_dist + rm -rf /tmp/workflow-ui-build + - uses: actions/setup-go@v5 with: go-version: '1.26' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9c9faa --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Compiled UI assets (built via 'make ui' or CI) +internal/ui_dist/* +!internal/ui_dist/index.html + +# Build output +bin/ +dist/ + +# Go +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Node (UI build artifacts) +node_modules/ + +# OS +.DS_Store diff --git a/Makefile b/Makefile index 931f946..f2cd948 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ install: build mkdir -p $(DESTDIR)/$(INSTALL_DIR) cp bin/$(BINARY_NAME) $(DESTDIR)/$(INSTALL_DIR)/ cp plugin.json $(DESTDIR)/$(INSTALL_DIR)/ - cp -r ui_dist $(DESTDIR)/$(INSTALL_DIR)/ clean: rm -rf bin/ @@ -22,5 +21,5 @@ ui: @echo "Building admin UI from workflow repo..." cd /tmp && rm -rf workflow-ui-build && git clone --depth 1 git@github.com:GoCodeAlone/workflow.git workflow-ui-build cd /tmp/workflow-ui-build/ui && npm ci && npx vite build - rm -rf ui_dist && cp -r /tmp/workflow-ui-build/ui/dist ui_dist + rm -rf internal/ui_dist && cp -r /tmp/workflow-ui-build/ui/dist internal/ui_dist rm -rf /tmp/workflow-ui-build diff --git a/internal/ui_dist/index.html b/internal/ui_dist/index.html index 7415683..6e73ec1 100644 --- a/internal/ui_dist/index.html +++ b/internal/ui_dist/index.html @@ -1,2 +1,4 @@ - -Admin UI not built. Run 'make ui' to build. + + +Run 'make ui' to build admin UI +