mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
[ci] add explicit flow for makefile, add make install
This commit is contained in:
parent
1ec5583931
commit
9ef50968cf
2 changed files with 19 additions and 15 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -48,7 +48,7 @@ jobs:
|
|||
cache-dependency-path: ui/v2.5/pnpm-lock.yaml
|
||||
|
||||
- name: Install UI dependencies
|
||||
run: cd ui/v2.5 && pnpm install --frozen-lockfile
|
||||
run: make pre-ui
|
||||
|
||||
- name: Generate
|
||||
run: make generate
|
||||
|
|
|
|||
32
Makefile
32
Makefile
|
|
@ -10,10 +10,12 @@ ifdef IS_WIN_SHELL
|
|||
RM := del /s /q
|
||||
RMDIR := rmdir /s /q
|
||||
NOOP := @@
|
||||
PREFIX := $(USERPROFILE)\\bin
|
||||
else
|
||||
RM := rm -f
|
||||
RMDIR := rm -rf
|
||||
NOOP := @:
|
||||
PREFIX := $(HOME)/.local
|
||||
endif
|
||||
|
||||
# set LDFLAGS environment variable to any extra ldflags required
|
||||
|
|
@ -40,9 +42,6 @@ GO_BUILD_FLAGS := $(GO_BUILD_FLAGS)
|
|||
GO_BUILD_TAGS := $(GO_BUILD_TAGS)
|
||||
GO_BUILD_TAGS += sqlite_stat4 sqlite_math_functions
|
||||
|
||||
# set STASH_NOLEGACY environment variable or uncomment to disable legacy browser support
|
||||
# STASH_NOLEGACY := true
|
||||
|
||||
# set STASH_SOURCEMAPS environment variable or uncomment to enable UI sourcemaps
|
||||
# STASH_SOURCEMAPS := true
|
||||
|
||||
|
|
@ -271,10 +270,8 @@ build-cc-all:
|
|||
touch-ui:
|
||||
ifdef IS_WIN_SHELL
|
||||
@if not exist "ui\\v2.5\\build" mkdir ui\\v2.5\\build
|
||||
@type nul >> ui/v2.5/build/index.html
|
||||
else
|
||||
@mkdir -p ui/v2.5/build
|
||||
@touch ui/v2.5/build/index.html
|
||||
endif
|
||||
|
||||
# Regenerates GraphQL files
|
||||
|
|
@ -282,7 +279,7 @@ endif
|
|||
generate: generate-backend generate-ui
|
||||
|
||||
.PHONY: generate-ui
|
||||
generate-ui:
|
||||
generate-ui: pre-ui
|
||||
cd ui/v2.5 && npm run gqlgen
|
||||
|
||||
.PHONY: generate-backend
|
||||
|
|
@ -318,7 +315,7 @@ test:
|
|||
|
||||
# runs all tests - including integration tests
|
||||
.PHONY: it
|
||||
it:
|
||||
it: generate
|
||||
$(eval GO_BUILD_TAGS += integration)
|
||||
go test -tags "$(GO_BUILD_TAGS)" ./...
|
||||
|
||||
|
|
@ -365,18 +362,15 @@ ui-env: build-info
|
|||
$(eval export VITE_APP_DATE := $(BUILD_DATE))
|
||||
$(eval export VITE_APP_GITHASH := $(GITHASH))
|
||||
$(eval export VITE_APP_STASH_VERSION := $(STASH_VERSION))
|
||||
ifdef STASH_NOLEGACY
|
||||
$(eval export VITE_APP_NOLEGACY := true)
|
||||
endif
|
||||
ifdef STASH_SOURCEMAPS
|
||||
$(eval export VITE_APP_SOURCEMAPS := true)
|
||||
endif
|
||||
|
||||
.PHONY: ui
|
||||
ui: ui-only generate-login-locale
|
||||
ui: pre-ui generate ui-only generate-login-locale
|
||||
|
||||
.PHONY: ui-only
|
||||
ui-only: ui-env
|
||||
ui-only: ui-env generate ui
|
||||
cd ui/v2.5 && npm run build
|
||||
|
||||
.PHONY: zip-ui
|
||||
|
|
@ -394,7 +388,7 @@ fmt-ui:
|
|||
|
||||
# runs all of the frontend PR-acceptance steps
|
||||
.PHONY: validate-ui
|
||||
validate-ui:
|
||||
validate-ui: pre-ui generate
|
||||
cd ui/v2.5 && npm run validate
|
||||
|
||||
# these targets run the same steps as fmt-ui and validate-ui, but only on files that have changed
|
||||
|
|
@ -444,4 +438,14 @@ start-compiler-container:
|
|||
|
||||
.PHONY: remove-compiler-container
|
||||
remove-compiler-container:
|
||||
docker rm -f -v build
|
||||
docker rm -f -v build
|
||||
|
||||
.PHONY: install
|
||||
install: build-release
|
||||
ifdef IS_WIN_SHELL
|
||||
@if not exist "$(PREFIX)" mkdir $(PREFIX)
|
||||
@copy "dist\\stash-win.exe" "$(PREFIX)\\stash-win.exe"
|
||||
else
|
||||
@mkdir -p $(PREFIX)/bin
|
||||
@install -m 755 $(STASH_OUTPUT) $(PREFIX)/bin/stash
|
||||
endif
|
||||
Loading…
Reference in a new issue