v1.2.0: ci: ci and makefile
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
cbe5e3ed63
commit
b9f7a8fd11
2 changed files with 74 additions and 0 deletions
28
Makefile
Normal file
28
Makefile
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
ARCH := amd64 arm64
|
||||
OS := linux windows darwin
|
||||
NAME := password
|
||||
VERSION := $(shell git describe)
|
||||
BUILD := $(shell git rev-parse HEAD)
|
||||
|
||||
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
|
||||
|
||||
.PHONY: all build
|
||||
|
||||
all: build
|
||||
|
||||
build_password:
|
||||
$(foreach GOOS, ${OS},\
|
||||
$(foreach GOARCH, ${ARCH}, \
|
||||
$(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
|
||||
|
||||
re: clean all
|
||||
Loading…
Add table
Add a link
Reference in a new issue