From 67648811a59fb77843db4c168ce444d13c97644d Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Fri, 11 Dec 2020 15:57:24 +0300 Subject: [PATCH] fix: save the version when building manually --- .github/workflows/binary-release.yml | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/binary-release.yml b/.github/workflows/binary-release.yml index f957d35..bcc9e0e 100644 --- a/.github/workflows/binary-release.yml +++ b/.github/workflows/binary-release.yml @@ -23,7 +23,7 @@ jobs: go-version: '1.13.0' - name: Build - run: make -j $(nproc) compile VERSION=${{ steps.get_version.outputs.VERSION }} + run: make -j $(nproc) compile - name: create release id: create_release @@ -32,7 +32,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.get_version.outputs.VERSION }} - release_name: Release ${{ steps.get_version.outputs.VERSION }} + release_name: multini ${{ steps.get_version.outputs.VERSION }} draft: false prerelease: false diff --git a/Makefile b/Makefile index 0128f40..ef323b9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = multini -VERSION = dev_$(shell date +%F_%T) +VERSION := $(shell git describe) GOCMD = go LDFLAGS := "$(LDFLAGS) -s -w -X 'main.Version=$(VERSION)'" GOBUILD = $(GOCMD) build -ldflags=$(LDFLAGS)