update: Makefile

This commit is contained in:
KaySar12 2024-10-04 14:12:49 +07:00
parent fc915ebda5
commit 24369c69fa
2 changed files with 14 additions and 14 deletions

View File

@ -145,9 +145,9 @@ archives:
- name_template: >- - name_template: >-
{{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }} {{ .Os }}-{{- if eq .Arch "arm" }}arm-7{{- else }}{{ .Arch }}{{- end }}-{{ .ProjectName }}-v{{ .Version }}
builds: builds:
- casaos-user-service-amd64 - nextzen-user-service-amd64
- casaos-user-service-arm64 - nextzen-user-service-arm64
- casaos-user-service-arm-7 - nextzen-user-service-arm-7
files: files:
- build/**/* - build/**/*
# - name_template: >- # - name_template: >-
@ -169,11 +169,12 @@ changelog:
exclude: exclude:
- "^docs:" - "^docs:"
- "^test:" - "^test:"
- "^update:"
release: release:
github: github:
owner: KaySar12 owner: IceWhaleTech
name: NextZen-UserService name: CasaOS-UserService
draft: true draft: true
prerelease: auto prerelease: auto
mode: replace mode: replace
name_template: "v{{ .Version }}" name_template: "v{{ .Version }}"

View File

@ -9,12 +9,11 @@ VERSION=v1
BIN_PATH=build/sysroot/usr/bin BIN_PATH=build/sysroot/usr/bin
BUILD_PATH=build BUILD_PATH=build
CUR_DIR=$(PWD) CUR_DIR=$(PWD)
CUR_TAG ?= $(shell git describe --tags --match '*.*.*' | sort -V | tail -n1) CUR_TAG ?= $(shell git describe --tags --match '*.*.*' | sort -V | tail -n1 | sed 's/-[0-9]*-g[0-9a-f]*//')
PREV_TAG ?= $(shell git describe --tags --match '*.*.*' | sort -V | head -n2 | tail -n1) PREV_TAG ?= $(shell git describe --tags --match '*.*.*' | sort -V | head -n2 | tail -n1 | sed 's/-[0-9]*-g[0-9a-f]*//')
ARCHIVE_PATH=buildzip ARCHIVE_PATH=buildzip
PACKAGE_NAME=$(OS)-$(ARCHITECHTURE)-nextzenos-user-service-$(TAG) PACKAGE_NAME=$(OS)-$(ARCHITECHTURE)-nextzenos-user-service-$(TAG)
COMMIT_MESSAGE ?="update"
GIT_COMMIT_MESSAGE ?="update"
build_service: build_service:
$(GORELEASERBUILD) --clean --snapshot -f .goreleaser.debug.yaml --id $(SERVICE)-$(ARCHITECHTURE) $(GORELEASERBUILD) --clean --snapshot -f .goreleaser.debug.yaml --id $(SERVICE)-$(ARCHITECHTURE)
@ -30,7 +29,7 @@ remove_package:
clear_archive: clear_archive:
@rm -rf $(CUR_DIR)/$(ARCHIVE_PATH) @rm -rf $(CUR_DIR)/$(ARCHIVE_PATH)
#make create_tag CUR_TAG=x.x TAG_MESSAGE="this is tag message" #make create_tag CUR_TAG=x.x TAG_MESSAGE="this is tag message"
create_tag:push_git create_tag:
@${GIT} tag -a ${CUR_TAG} -m "${TAG_MESSAGE}" || { echo "Failed to create tag"; exit 1; } @${GIT} tag -a ${CUR_TAG} -m "${TAG_MESSAGE}" || { echo "Failed to create tag"; exit 1; }
@${GIT} push ${GIT_REMOTE} ${CUR_TAG} || { echo "Failed to push tag"; exit 1; } @${GIT} push ${GIT_REMOTE} ${CUR_TAG} || { echo "Failed to push tag"; exit 1; }
#make remove_tag CUR_TAG=x.x #make remove_tag CUR_TAG=x.x
@ -40,12 +39,12 @@ remove_tag:
check_tag: check_tag:
@echo "Previous tag: $(PREV_TAG)"; @echo "Previous tag: $(PREV_TAG)";
@echo "Current tag: $(CUR_TAG)"; @echo "Current tag: $(CUR_TAG)";
push_release_all:push_git push_release_all:
${GORELEASER} release --clean -f .goreleaser.yaml ${GORELEASER} release --clean -f .goreleaser.yaml
push_release:push_git push_release:
${GORELEASER} release --single-target ${GORELEASER} release --single-target
push_git: push_git:
@${GIT} pull ${GIT_REMOTE} @${GIT} pull ${GIT_REMOTE}
@${GIT} add . @${GIT} add .
@${GIT} commit -m "${GIT_COMMIT_MESSAGE}" @${GIT} commit -m "${COMMIT_MESSAGE}"
@${GIT} push ${GIT_REMOTE} @${GIT} push ${GIT_REMOTE}