Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
89958930
Commit
89958930
authored
Oct 19, 2021
by
suyanlong
Committed by
33cn
Oct 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Fixed version control
parent
6ebfb426
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
21 deletions
+102
-21
automake.yml
.github/workflows/automake.yml
+1
-0
release.yml
.github/workflows/release.yml
+1
-0
.releaserc.yml
.releaserc.yml
+60
-19
Makefile
Makefile
+8
-2
main.go
main.go
+16
-0
version.go
version/version.go
+16
-0
No files found.
.github/workflows/automake.yml
View file @
89958930
...
@@ -39,6 +39,7 @@ jobs:
...
@@ -39,6 +39,7 @@ jobs:
with
:
with
:
branch
:
master
branch
:
master
extra_plugins
:
|
extra_plugins
:
|
@google/semantic-release-replace-plugin
@semantic-release/exec
@semantic-release/exec
@semantic-release/changelog
@semantic-release/changelog
@semantic-release/git
@semantic-release/git
...
...
.github/workflows/release.yml
View file @
89958930
...
@@ -29,6 +29,7 @@ jobs:
...
@@ -29,6 +29,7 @@ jobs:
with
:
with
:
branch
:
master
branch
:
master
extra_plugins
:
|
extra_plugins
:
|
@google/semantic-release-replace-plugin
@semantic-release/exec
@semantic-release/exec
@semantic-release/changelog
@semantic-release/changelog
@semantic-release/git
@semantic-release/git
...
...
.releaserc.yml
View file @
89958930
{
"
branches"
:
[
"
master"
,
"
next"
],
{
"
branches"
:
[
"
master"
,
"
next"
],
"
plugins"
:
[
"
plugins"
:
[
"
@semantic-release/commit-analyzer"
,
#Default 1
"
@semantic-release/commit-analyzer"
,
#Default 1
"
@semantic-release/release-notes-generator"
,
#Default 2
"
@semantic-release/release-notes-generator"
,
#Default 2
[
[
"
@semantic-release/changelog"
,
"
@google/semantic-release-replace-plugin"
,
{
"
changelogFile"
:
"
CHANGELOG.md"
,
"
changelogTitle"
:
"
changelog"
},
{
],
"
replacements"
:
[
# "@semantic-release/npm", #Default 3
{
# "@semantic-release/github", #Default 4
"
files"
:
[
"
version/version.go"
],
[
"
from"
:
'
Version
=.*'
,
"
@semantic-release/github"
,
"
to"
:
'
Version
=
"${nextRelease.version}"'
,
{
"
assets"
:
[
"
build/*.tar.gz"
,
"
build/*.zip"
]}
"
results"
:
[
],
{
"
file"
:
"
version/version.go"
,
"
hasChanged"
:
true
,
"
numMatches"
:
1
,
"
numReplacements"
:
1
}
],
"
countMatches"
:
true
},
{
{
"
files"
:
[
"
README.md"
],
"
from"
:
"
#
chain33
官方插件系统(.*)"
,
"
to"
:
"
#
chain33
官方插件系统(v${nextRelease.version})"
,
"
results"
:
[
{
"
file"
:
"
README.md"
,
"
hasChanged"
:
true
,
"
numMatches"
:
1
,
"
numReplacements"
:
1
}
],
"
countMatches"
:
true
},
}
]
}
],
[
"
@semantic-release/changelog"
,
{
"
changelogFile"
:
"
CHANGELOG.md"
,
"
changelogTitle"
:
"
changelog"
},
],
# "@semantic-release/npm", #Default 3
# "@semantic-release/github", #Default 4
[
"
@semantic-release/github"
,
{
"
assets"
:
[
"
build/*.tar.gz"
,
"
build/*.zip"
]}
],
[
"
@semantic-release/git"
,
"
@semantic-release/git"
,
[
{
"
@semantic-release/exec"
,
{
"
assets"
:
[
"
version/version.go"
,
"
CHANGELOG.md"
,
"
README.md"
],
"
prepareCmd"
:
"
make
all-arch"
}
}
],
]
[
"
@semantic-release/exec"
,
{
"
prepareCmd"
:
"
make
all-arch
VERSION=${nextRelease.version}"
}
]
]
]
}
}
Makefile
View file @
89958930
...
@@ -8,8 +8,14 @@ export GO111MODULE=on
...
@@ -8,8 +8,14 @@ export GO111MODULE=on
CLI
:=
build/chain33-cli
CLI
:=
build/chain33-cli
SRC_CLI
:=
github.com/33cn/plugin/cli
SRC_CLI
:=
github.com/33cn/plugin/cli
APP
:=
build/chain33
APP
:=
build/chain33
BUILD_FLAGS
=
-ldflags
"-X github.com/33cn/chain33/common/version.GitCommit=
`
git rev-parse
--short
=
8 HEAD
`
"
LDFLAGS
:=
' -w -s'
LDFLAGS
:=
-ldflags
"-w -s"
BUILDTIME
:=
$(
shell
date
+
"%Y-%m-%d %H:%M:%S %A"
)
VERSION
=
$(
shell
git describe
--tags
||
git rev-parse
--short
=
8 HEAD
)
GitCommit
=
$(
shell
git rev-parse
--short
=
8 HEAD
)
BUILD_FLAGS
:=
-ldflags
'-X "github.com/33cn/plugin/version.GitCommit=
$(GitCommit)
" \
-X "github.com/33cn/plugin/version.Version=
$(VERSION)
" \
-X "github.com/33cn/plugin/version.BuildTime=
$(BUILDTIME)
"'
MKPATH
=
$
(
abspath
$
(
lastword
$(MAKEFILE_LIST)
))
MKPATH
=
$
(
abspath
$
(
lastword
$(MAKEFILE_LIST)
))
MKDIR
=
$
(
dir
$(MKPATH)
)
MKDIR
=
$
(
dir
$(MKPATH)
)
proj
:=
"build"
proj
:=
"build"
...
...
main.go
View file @
89958930
...
@@ -12,11 +12,27 @@
...
@@ -12,11 +12,27 @@
package
main
package
main
import
(
import
(
"flag"
"fmt"
frameVersion
"github.com/33cn/chain33/common/version"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/chain33/system"
"github.com/33cn/chain33/util/cli"
"github.com/33cn/chain33/util/cli"
_
"github.com/33cn/plugin/plugin"
_
"github.com/33cn/plugin/plugin"
"github.com/33cn/plugin/version"
)
var
(
versionCmd
=
flag
.
Bool
(
"version"
,
false
,
"detail version"
)
)
)
func
main
()
{
func
main
()
{
flag
.
Parse
()
if
*
versionCmd
{
fmt
.
Println
(
fmt
.
Sprintf
(
"build time: %s"
,
version
.
BuildTime
))
fmt
.
Println
(
fmt
.
Sprintf
(
"plugin version: %s"
,
version
.
GetVersion
()))
fmt
.
Println
(
fmt
.
Sprintf
(
"chain33 frame version: %s"
,
frameVersion
.
GetVersion
()))
return
}
cli
.
RunChain33
(
""
,
""
)
cli
.
RunChain33
(
""
,
""
)
}
}
version/version.go
0 → 100644
View file @
89958930
package
version
//var version control
var
(
Version
=
"master"
GitCommit
string
BuildTime
string
)
//GetVersion 获取版本信息
func
GetVersion
()
string
{
if
GitCommit
!=
""
{
return
Version
+
"-"
+
GitCommit
}
return
Version
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment