Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Version
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Utilities
Version
Commits
76743c2f
Verified
Commit
76743c2f
authored
Jan 3, 2024
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: test gorelease
parent
ea34d8fa
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitlab-ci.yml
+23
-2
23 additions, 2 deletions
.gitlab-ci.yml
.goreleaser.yml
+1
-1
1 addition, 1 deletion
.goreleaser.yml
devenv.nix
+36
-2
36 additions, 2 deletions
devenv.nix
source/commandline.go
+5
-1
5 additions, 1 deletion
source/commandline.go
source/release.go
+16
-0
16 additions, 0 deletions
source/release.go
with
81 additions
and
6 deletions
.gitlab-ci.yml
+
23
−
2
View file @
76743c2f
...
@@ -16,9 +16,31 @@ variables:
...
@@ -16,9 +16,31 @@ variables:
stages
:
stages
:
# - build
# - build
#
-
deploy
-
tag
-
release
-
release
tag-it
:
stage
:
tag
script
:
-
git config user.email "''${GITLAB_USER_EMAIL}"
-
git config user.name "''${GITLAB_USER_NAME:-"Gitlab CI"}"
-
git config credential.helper '!f() { echo "username=gitlab-ci-token"; echo "password=''${CI_JOB_TOKEN}"; }; f'
-
git config pull.rebase
true
-
git config http.sslVerify "false"
-
git remote set-url origin https://pad:''${GITLAB_TOKEN}@''${CI_REPOSITORY_URL#*@}
-
git fetch --all --tags --unshallow
-
git reset --hard origin/master
-
git checkout $CI_COMMIT_REF_NAME
-
git pull origin $CI_COMMIT_REF_NAME
-
version auto exit-code-if-no-bump
-
git push origin $CI_COMMIT_REF_NAME
only
:
## regex to x.y branches and master
-
master
except
:
-
tags
release
:
release
:
stage
:
release
stage
:
release
image
:
image
:
...
@@ -28,7 +50,6 @@ release:
...
@@ -28,7 +50,6 @@ release:
-
tags
-
tags
variables
:
variables
:
# Disable shallow cloning so that goreleaser can diff between tags to
# Disable shallow cloning so that goreleaser can diff between tags to
# generate a changelog.
GIT_DEPTH
:
0
GIT_DEPTH
:
0
script
:
script
:
-
cd source; goreleaser release --clean
-
cd source; goreleaser release --clean
...
...
This diff is collapsed.
Click to expand it.
.goreleaser.yml
+
1
−
1
View file @
76743c2f
/nix/store/nil8y275ifgp8i2psgfi5ls53qmhihsn-goreleaser.yml
/nix/store/69q2b7irlnvf3cpf80gq07nm3mn6yf9r-goreleaser.yml
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
devenv.nix
+
36
−
2
View file @
76743c2f
...
@@ -43,7 +43,7 @@ tasks:
...
@@ -43,7 +43,7 @@ tasks:
text
=
''
text
=
''
# .goreleaser.yml
# .goreleaser.yml
gitlab_urls:
gitlab_urls:
api: https://gitlab.schukai.com/api/v4
/
api: https://gitlab.schukai.com/api/v4
download: https://gitlab.schukai.com
download: https://gitlab.schukai.com
# set to true if you use a self-signed certificate
# set to true if you use a self-signed certificate
...
@@ -55,9 +55,43 @@ gitlab_urls:
...
@@ -55,9 +55,43 @@ gitlab_urls:
# Since: v1.11
# Since: v1.11
use_job_token: false
use_job_token: false
project_name: version
project_name: version
builds:
- id: version
goos:
- linux
# - darwin
# - windows
goarch:
- amd64
# - arm64
# - "386"
goarm:
- "6"
# gomips:
# - hardfloat
# goamd64:
# - v1
targets:
# - linux_amd64_v1
- linux_arm64
# - linux_386
# - darwin_amd64_v1
# - darwin_arm64
# - windows_amd64_v1
# - windows_arm64
# - windows_386
dir: source
#main: source/main.go
# binary: version
# builder: go
# gobinary: go
# command: build
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.build={{.Date}}
''
;
''
;
};
};
...
...
This diff is collapsed.
Click to expand it.
source/commandline.go
+
5
−
1
View file @
76743c2f
...
@@ -111,7 +111,11 @@ func executeCommand() {
...
@@ -111,7 +111,11 @@ func executeCommand() {
}
}
if
command
==
"version"
{
if
command
==
"version"
{
fmt
.
Println
(
GetMnemonic
()
+
" "
+
GetVersion
()
+
" ("
+
GetBuild
()
+
")"
)
fmt
.
Println
(
"Name: "
,
GetName
())
fmt
.
Println
(
"Version: "
,
GetVersion
())
fmt
.
Println
(
"Build: "
,
GetBuild
())
fmt
.
Println
(
"Commit: "
,
GetCommit
())
fmt
.
Println
(
"Mnemonic: "
,
GetMnemonic
())
return
return
}
}
...
...
This diff is collapsed.
Click to expand it.
source/release.go
+
16
−
0
View file @
76743c2f
...
@@ -6,18 +6,24 @@ var (
...
@@ -6,18 +6,24 @@ var (
version
=
"dev"
version
=
"dev"
build
=
"n/a"
build
=
"n/a"
mnemonic
=
"version"
mnemonic
=
"version"
name
=
"Version"
commit
=
"n/a"
)
)
type
Accessor
interface
{
type
Accessor
interface
{
GetVersion
()
string
GetVersion
()
string
GetBuild
()
string
GetBuild
()
string
GetMnemonic
()
string
GetMnemonic
()
string
GetCommit
()
string
GetName
()
string
}
}
type
ReleaseStruct
struct
{
type
ReleaseStruct
struct
{
Version
string
Version
string
Build
string
Build
string
Mnemonic
string
Mnemonic
string
Commit
string
Name
string
}
}
var
release
ReleaseStruct
var
release
ReleaseStruct
...
@@ -28,6 +34,8 @@ func init() {
...
@@ -28,6 +34,8 @@ func init() {
Version
:
version
,
Version
:
version
,
Build
:
build
,
Build
:
build
,
Mnemonic
:
mnemonic
,
Mnemonic
:
mnemonic
,
Commit
:
commit
,
Name
:
name
,
}
}
}
}
...
@@ -42,3 +50,11 @@ func GetBuild() string {
...
@@ -42,3 +50,11 @@ func GetBuild() string {
func
GetMnemonic
()
string
{
func
GetMnemonic
()
string
{
return
release
.
Mnemonic
return
release
.
Mnemonic
}
}
func
GetCommit
()
string
{
return
release
.
Commit
}
func
GetName
()
string
{
return
release
.
Name
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment