make complete publish script #2
All checks were successful
/ publish_password (push) Successful in 6m40s

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-08-10 14:11:58 +02:00
commit f9ce04a257
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 47 additions and 25 deletions

View file

@ -1,14 +1,10 @@
ARCH := amd64 arm64
OS := linux windows darwin
NAME := password
VERSION := $(shell git describe)
BUILD := $(shell git rev-parse HEAD)
ARCH := amd64 arm64
OS := linux windows darwin
NAME := password
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
.PHONY: all build_password
.PHONY: all build
all: build
all: build_password
build_password:
$(foreach GOOS, ${OS},\
@ -16,12 +12,6 @@ build_password:
$(shell CGO_ENABLED=0 go build -v -o bin/${NAME} ./golang/cmd/passwordhash;cd bin/;[ "${GOOS}" = "windows" ] && mv ${NAME} ${NAME}.exe;tar czf ${NAME}_${GOOS}_${GOARCH}.tar.gz *;rm -f ${NAME} ${NAME}.exe) \
))
publish_password:
$(foreach GOOS, ${OS},\
$(foreach GOARCH, ${ARCH}, \
$(curl --silent --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file bin/${NAME}_${GOOS}_${GOARCH}.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${NAME}/${VER}/${NAME}_${GOOS}_${GOARCH}.tar.gz") \
))
clean:
rm -rf bin