fix_: pass proper version to params (#5735)

* fix_: pass proper version to params

* fix_: use --dirty flag

* fix_: delete version_test

* fix_: pass proper version to artifacts
This commit is contained in:
Igor Sirotin 2024-08-19 16:47:11 +01:00 committed by GitHub
parent ab675a2c99
commit ef85895f65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 8 additions and 26 deletions

View File

@ -29,7 +29,7 @@ help: SHELL := /bin/sh
help: ##@other Show this help
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
RELEASE_TAG := v$(file < VERSION)
RELEASE_TAG:=$(shell ./_assets/scripts/version.sh)
RELEASE_DIR := /tmp/release-$(RELEASE_TAG)
GOLANGCI_BINARY=golangci-lint
IPFS_GATEWAY_URL ?= https://ipfs.status.im/

View File

@ -1 +0,0 @@
0.179.11

View File

@ -38,7 +38,7 @@ pipeline {
GOCACHE = "${WORKSPACE_TMP}/gocache"
PATH = "${PATH}:${GOPATH}/bin"
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
ARTIFACT = utils.pkgFilename(name: "status-go", type: "android", ext: "aar", version: null)
ARTIFACT = utils.pkgFilename(name: "status-go", type: "android", ext: "aar", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true))
}
stages {

View File

@ -38,7 +38,7 @@ pipeline {
GOCACHE = "${WORKSPACE_TMP}/gocache"
PATH = "${PATH}:${GOPATH}/bin"
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
ARTIFACT = utils.pkgFilename(name: "status-go", type: "ios", ext: "zip", version: null)
ARTIFACT = utils.pkgFilename(name: "status-go", type: "ios", ext: "zip", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true))
/* fix for gomobile complaining about missing packages */
CGO_ENABLED = "1"
}

View File

@ -38,7 +38,7 @@ pipeline {
GOCACHE = "${WORKSPACE_TMP}/gocache"
PATH = "${PATH}:${GOPATH}/bin"
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
ARTIFACT = utils.pkgFilename(name: "status-go", type: "desktop", ext: "zip", version: null)
ARTIFACT = utils.pkgFilename(name: "status-go", type: "desktop", ext: "zip", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true))
}
stages {

2
_assets/scripts/version.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
git describe --tags --dirty="-dirty"

View File

@ -1,7 +1,7 @@
package params
// Version is defined in VERSION file.
// We set it in loadNodeConfig() in api/backend.go.
// Version is defined in git tags.
// We set it from the Makefile.
var Version string
// GitCommit is a commit hash.

View File

@ -1,19 +0,0 @@
package params_test
import (
"io/ioutil"
"path/filepath"
"regexp"
"testing"
)
func TestVersionFormat(t *testing.T) {
data, err := ioutil.ReadFile(filepath.Join("..", "VERSION"))
if err != nil {
t.Error("unable to open VERSION file")
}
matched, _ := regexp.Match(`^\d+\.\d+\.\d+(-[.\w]+)?\n?$`, data)
if !matched {
t.Error("version in incorrect format")
}
}