github-action/Makefile
Percy Wegmann cf94bd9cf6 support "unstable" version option on all platforms except macOS
The tailscale repo does not get tagged for unstable builds, so the best we can do when
building macOS from source is to build from the HEAD of `main`.

Updates tailscale/corp#32813

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00

42 lines
757 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 format
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