Skip to content

Commit

Permalink
Revert Makefile and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Grigorev committed Apr 23, 2024
1 parent 1e48e11 commit 711f279
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 39 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,3 @@ jobs:
- name: Run test
run: make test

build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
run: make docker-build-branch
32 changes: 5 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
DOCKER_ACCOUNT = cherts
APPNAME = pgscv
APPOS = linux
APPOS = ${GOOS}

TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
COMMIT := $(shell git rev-parse --short HEAD)
DATE := $(shell git log -1 --format=%cd --date=format:"%Y%m%d")
ifeq ($(TAG),)
VERSION := 0.8
else
#VERSION := $(TAG:v%=%)
VERSION := $(TAG)
endif
ifneq ($(COMMIT), $(TAG_COMMIT))
VERSION := $(VERSION)-next-$(DATE)
endif
ifeq ($(VERSION),)
VERSION := $(COMMIT)-$(DATA)
endif
ifneq ($(shell git status --porcelain),)
VERSION := $(VERSION)-dirty
endif
#APPOS = ${GOOS}

TAG=$(shell git tag -l --sort=-creatordate | head -n 1)
COMMIT=$(shell git rev-parse --short HEAD)
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)

LDFLAGS = -a -installsuffix cgo -ldflags "-X main.appName=${APPNAME} -X main.gitTag=${VERSION} -X main.gitCommit=${COMMIT} -X main.gitBranch=${BRANCH}"
LDFLAGS = -a -installsuffix cgo -ldflags "-X main.appName=${APPNAME} -X main.gitTag=${TAG} -X main.gitCommit=${COMMIT} -X main.gitBranch=${BRANCH}"

.PHONY: help \
clean lint test race \
Expand Down Expand Up @@ -72,11 +55,6 @@ docker-build: ## Build docker image
docker image prune --force --filter label=stage=intermediate
docker tag ${DOCKER_ACCOUNT}/${APPNAME}:${TAG} ${DOCKER_ACCOUNT}/${APPNAME}:latest

docker-build-branch: ## Build docker image from branch for test purposes
docker build -t ${DOCKER_ACCOUNT}/${APPNAME}:${BRANCH} .
docker image prune --force --filter label=stage=intermediate
#docker push ${DOCKER_ACCOUNT}/${APPNAME}:${BRANCH}

docker-push: ## Push docker image
docker push ${DOCKER_ACCOUNT}/${APPNAME}:${TAG}
docker push ${DOCKER_ACCOUNT}/${APPNAME}:latest
Expand Down

0 comments on commit 711f279

Please sign in to comment.