Files
software-station/Makefile
Sudo-Ivan 4c60e3cf4a
All checks were successful
renovate / renovate (push) Successful in 2m8s
CI / build (push) Successful in 10m24s
Update asset verification and user experience
- Added SRI hash injection during frontend build to improve security.
- Updated ESLint configuration to include 'navigator' as a global variable.
- Introduced a new `settingsStore` to manage user preferences for asset verification.
- Enhanced `SoftwareCard` and `VerificationModal` components to display contributor information and security checks.
- Updated `verificationStore` to handle expanded toast notifications for detailed verification steps.
- Implemented a new `CodeBlock` component for displaying code snippets with syntax highlighting.
- Improved API documentation and added new endpoints for fetching software and asset details.
2025-12-27 16:29:05 -06:00

73 lines
1.7 KiB
Makefile

.PHONY: all build-frontend build-go build-wasm clean release run lint scan check format test test-wasm dev docker-build
BINARY_NAME=software-station
FRONTEND_DIR=frontend
BUILD_DIR=build
VERIFIER_DIR=software-verifier
WASM_OUT=frontend/static/verifier
VERSION=$(shell grep '"version":' $(FRONTEND_DIR)/package.json | cut -d'"' -f4)
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
VCS_REF=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
all: build-wasm build-frontend build-go
dev:
@echo "Starting development environment..."
@pnpm --prefix $(FRONTEND_DIR) dev & go run main.go
build-wasm:
@echo "Building WASM verifier..."
mkdir -p $(WASM_OUT)
cp "$(shell go env GOROOT)/lib/wasm/wasm_exec.js" $(WASM_OUT)/wasm_exec.js
cd $(VERIFIER_DIR) && GOOS=js GOARCH=wasm go build -o ../$(WASM_OUT)/verifier.wasm .
build-frontend: build-wasm
cd $(FRONTEND_DIR) && pnpm install && pnpm build
@echo "Injecting SRI hashes..."
go run scripts/sri-gen/main.go
build-go:
go build -o $(BINARY_NAME) main.go
release: build-frontend
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(BINARY_NAME) main.go
@echo "Release build complete: $(BINARY_NAME)"
run: all
./$(BINARY_NAME)
format:
go fmt ./...
cd $(FRONTEND_DIR) && pnpm run format
lint:
go vet ./...
cd $(FRONTEND_DIR) && pnpm run lint
scan:
gosec ./...
check:
cd $(FRONTEND_DIR) && pnpm run check
test: test-wasm
go test -v -coverpkg=./... ./...
test-wasm:
cd $(VERIFIER_DIR) && go test -v ./...
clean:
rm -rf $(FRONTEND_DIR)/build
rm -rf $(WASM_OUT)
rm -f $(BINARY_NAME)
rm -f coverage.out
docker-build:
docker build \
--build-arg VERSION=$(VERSION) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--build-arg VCS_REF=$(VCS_REF) \
-t $(BINARY_NAME):latest \
-t $(BINARY_NAME):$(VERSION) .