github-action/Makefile
Lee Briggs ece0596be3 initial commit
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00

42 lines
750 B
Makefile

# Makefile for building a TypeScript GitHub Action
# Variables
SHELL := /bin/bash
SRC_DIR := src
BUILD_DIR := dist
ENTRY_POINT := $(SRC_DIR)/index.ts
# Binaries
TS_NODE := ./node_modules/.bin/ts-node
TS_C := ./node_modules/.bin/tsc
ESLINT := ./node_modules/.bin/eslint
PRETTIER := ./node_modules/.bin/prettier
# Targets
.PHONY: all clean install build format
all: clean install build
# Clean up the lib directory
clean:
rm -rf $(BUILD_DIR)
# Install npm dependencies
install:
npm install
# Build the TypeScript code
build: clean
npm run build
# Lint the TypeScript code
lint:
$(ESLINT) $(SRC_DIR)
# Format the TypeScript code
format:
$(PRETTIER) --write "$(SRC_DIR)/**/*.ts"
# Run the action locally (for testing purposes)
run: build