Skip to content

Commit 88f7308

Browse files
committed
chore: optimize build artifacts and update copyright
- Add post hook to compress build artifacts using xz - Include compressed artifacts in the release and checksums - Update copyright dynamically with the current year Signed-off-by: appleboy <appleboy.tw@gmail.com>
1 parent 3be0fd4 commit 88f7308

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.goreleaser.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ builds:
7171
{{- else }}{{ .Arch }}{{ end }}
7272
{{- if .Arm }}-{{ .Arm }}{{ end }}
7373
no_unique_dist_dir: true
74+
hooks:
75+
post:
76+
- cmd: xz -k -9 {{ .Path }}
77+
dir: ./dist/
7478

7579
archives:
7680
- format: binary
@@ -79,6 +83,17 @@ archives:
7983

8084
checksum:
8185
name_template: 'checksums.txt'
86+
extra_files:
87+
- glob: ./**.xz
8288

8389
snapshot:
8490
name_template: "{{ incpatch .Version }}"
91+
92+
release:
93+
# You can add extra pre-existing files to the release.
94+
# The filename on the release will be the last part of the path (base).
95+
# If another file with the same name exists, the last one found will be used.
96+
#
97+
# Templates: allowed
98+
extra_files:
99+
- glob: ./**.xz

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package main
33
import (
44
"log"
55
"os"
6+
"strconv"
7+
"time"
68

79
"github.com/joho/godotenv"
810
_ "github.com/joho/godotenv/autoload"
@@ -23,7 +25,7 @@ func main() {
2325
app := cli.NewApp()
2426
app.Name = "Drone Lambda"
2527
app.Usage = "Deploying Lambda code with drone CI to an existing function"
26-
app.Copyright = "Copyright (c) 2020 Bo-Yi Wu"
28+
app.Copyright = "Copyright (c) " + strconv.Itoa(time.Now().Year()) + " Bo-Yi Wu"
2729
app.Authors = []*cli.Author{
2830
{
2931
Name: "Bo-Yi Wu",

0 commit comments

Comments
 (0)