Browse Source

remove requirement for version in RELEASE.json, the version is guessed from the git tag (#64)

Thibault "bui" Koechlin 5 năm trước cách đây
mục cha
commit
051a1b427a
3 tập tin đã thay đổi với 1 bổ sung7 xóa
  1. 0 5
      .github/workflows/build-binary-package.yml
  2. 1 1
      Makefile
  3. 0 1
      RELEASE.json

+ 0 - 5
.github/workflows/build-binary-package.yml

@@ -17,11 +17,6 @@ jobs:
       id: go
     - name: Check out code into the Go module directory
       uses: actions/checkout@v2
-    - name: Check tag == json version
-      run: |
-        jsonver=$(cat RELEASE.json | jq -r .Version)
-        lasttag=$(git for-each-ref --sort=-v:refname --count=1 --format '%(refname)'  | cut -d '/' -f3)
-        if [ ${jsonver} != ${lasttag} ] ; then echo "version mismatch : ${jsonver} in json, ${lasttag} in git" ; exit 2 ; else echo "${jsonver} == ${lasttag}" ; fi
     - name: Build the binaries
       run: make release
     - name: Upload to release

+ 1 - 1
Makefile

@@ -17,7 +17,7 @@ REQUIRE_GOVERSION="1.13"
 
 
 #Current versioning information from env
-export BUILD_VERSION=$(shell cat RELEASE.json | jq -r .Version)
+export BUILD_VERSION="$(shell git for-each-ref --sort=-v:refname --count=1 --format '%(refname)'  | cut -d '/' -f3)"
 export BUILD_GOVERSION="$(shell go version | cut -d " " -f3 | sed -r 's/[go]+//g')"
 export BUILD_CODENAME=$(shell cat RELEASE.json | jq -r .CodeName)
 export BUILD_TIMESTAMP=$(shell date +%F"_"%T)

+ 0 - 1
RELEASE.json

@@ -1,4 +1,3 @@
 {
-    "Version": "v0.1.2",
     "CodeName": "beta"
 }