File tree Expand file tree Collapse file tree 3 files changed +77
-6
lines changed Expand file tree Collapse file tree 3 files changed +77
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Release CLI
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - cli/v*
7
+ release :
8
+ types :
9
+ - published
10
+
11
+ permissions :
12
+ contents : write
13
+
14
+ jobs :
15
+ goreleaser :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Checkout
19
+ uses : actions/checkout@v4
20
+ - name : Set up Go
21
+ uses : actions/setup-go@v5
22
+ - name : Set VERSION
23
+ run : |
24
+ TAG="${{ github.event.inputs.version || github.ref_name }}"
25
+ # Get rid of the tag since the cli/ prefix confuses goreleaser.
26
+ git tag -d $TAG
27
+ echo "VERSION=${TAG#cli/v}" >> $GITHUB_ENV
28
+ - name : Run GoReleaser
29
+ uses : goreleaser/goreleaser-action@v6
30
+ with :
31
+ distribution : goreleaser
32
+ version : ' ~> v2'
33
+ args : release --clean --snapshot --verbose
34
+ env :
35
+ VERSION : ${{ github.event.ref }}
36
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37
+ - name : Upload assets
38
+ uses : actions/upload-artifact@v3
39
+ with :
40
+ name : release
41
+ path : dist/*
Original file line number Diff line number Diff line change
1
+ version : 2
2
+ snapshot :
3
+ name_template : ' {{.Env.VERSION}}'
4
+ builds :
5
+ - id : cli
6
+ main : ./cli
7
+ no_unique_dist_dir : true
8
+ binary : fput-{{.Os}}-{{.Arch}}
9
+ archives :
10
+ - format : binary
11
+ nfpms :
12
+ - id : cli
13
+ package_name : fluffy
14
+ builds :
15
+ - cli
16
+ homepage : ' https://github.com/chriskuehl/fluffy'
17
+ maintainer :
' Chris Kuehl <[email protected] >'
18
+ description : ' command-line tools for uploading to fluffy servers'
19
+ license : Apache-2.0
20
+ formats :
21
+ - deb
22
+ - rpm
23
+ - archlinux
24
+ contents :
25
+ - src : /usr/bin/fput-{{.Os}}-{{.Arch}}
26
+ dst : /usr/bin/fpb
27
+ type : symlink
28
+ - src : /usr/bin/fput-{{.Os}}-{{.Arch}}
29
+ dst : /usr/bin/fput
30
+ type : symlink
Original file line number Diff line number Diff line change @@ -412,19 +412,19 @@ func (v *regexpValue) Type() string {
412
412
var regex = regexpValue {}
413
413
414
414
// This will be set by the linker for release builds.
415
- var Version string
415
+ var version string
416
416
417
417
func init () {
418
418
buildInfo , ok := debug .ReadBuildInfo ()
419
419
if ! ok {
420
420
panic ("could not read build info" )
421
421
}
422
- if Version == "" {
423
- Version = buildInfo .Main .Version
422
+ if version == "" {
423
+ version = buildInfo .Main .Version
424
424
}
425
- version := fmt .Sprintf ("%s/%s" , Version , buildInfo .GoVersion )
426
- fpbCommand .Version = version
427
- fputCommand .Version = version
425
+ versionString := fmt .Sprintf ("%s/%s" , version , buildInfo .GoVersion )
426
+ fpbCommand .Version = versionString
427
+ fputCommand .Version = versionString
428
428
429
429
settings , err := getSettings ()
430
430
if err != nil {
You can’t perform that action at this time.
0 commit comments