File tree Expand file tree Collapse file tree 2 files changed +82
-0
lines changed Expand file tree Collapse file tree 2 files changed +82
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : release
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ releaseType :
6
+ description : " Release Type"
7
+ required : true
8
+ default : " snapshot"
9
+ type : choice
10
+ options :
11
+ - snapshot
12
+ # Nightly releases
13
+ schedule :
14
+ - cron : " 45 8 * * 1-5"
15
+
16
+ permissions :
17
+ contents : write
18
+
19
+ jobs :
20
+ release :
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - name : Checkout
24
+ uses : actions/checkout@v3
25
+ with :
26
+ fetch-depth : 0 # Needed by goreleaser to browse history.
27
+ - name : Set up Go
28
+ uses : actions/setup-go@v2
29
+ with :
30
+ go-version : 1.19
31
+ - name : Build with goreleaser
32
+ uses : goreleaser/goreleaser-action@v3
33
+ with :
34
+ distribution : goreleaser
35
+ version : latest
36
+ args : release --rm-dist --skip-publish --snapshot
37
+ env :
38
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
+ - name : Determine release tag
40
+ run : |
41
+ TAG=$(ls dist/*_checksums.txt | cut -d '_' -f 2 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+-dev')
42
+ echo "release_tag=$TAG" >> $GITHUB_ENV
43
+ - name : Publish release to GitHub
44
+ uses : softprops/action-gh-release@v1
45
+ with :
46
+ prerelease : true
47
+ fail_on_unmatched_files : true
48
+ tag_name : ${{ env.release_tag }}
49
+ files : |
50
+ dist/*_checksums.txt
51
+ dist/*.tar.gz
Original file line number Diff line number Diff line change
1
+ project_name : devbox
2
+ before :
3
+ hooks :
4
+ - go mod tidy
5
+ builds :
6
+ - main : ./cmd/devbox.go
7
+ binary : devbox
8
+ mod_timestamp : " {{ .CommitTimestamp }}" # For reproducible builds
9
+ ldflags :
10
+ - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}}
11
+ env :
12
+ - CGO_ENABLED=0
13
+ - GO111MODULE=on
14
+ goos :
15
+ - linux
16
+ - darwin
17
+ archives :
18
+ - files :
19
+ - no-files-will-match-* # Glob that does not match to create archive with only binaries.
20
+ name_template : " {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{if .Arm}}{{.Arm}}{{end}}"
21
+ snapshot :
22
+ name_template : ' {{ incpatch .Version }}-dev{{ time "20060102" }}'
23
+ checksum :
24
+ name_template : " {{ .ProjectName }}_{{ .Version }}_checksums.txt"
25
+ algorithm : sha256
26
+ release :
27
+ prerelease : auto
28
+ draft : true
29
+ github :
30
+ owner : jetpack-io
31
+ name : devbox
You can’t perform that action at this time.
0 commit comments