Skip to content

Commit

Permalink
chore: optimize build artifacts and update copyright
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
appleboy committed May 1, 2023
1 parent 3be0fd4 commit 88f7308
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ builds:
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }}
no_unique_dist_dir: true
hooks:
post:
- cmd: xz -k -9 {{ .Path }}
dir: ./dist/

archives:
- format: binary
Expand All @@ -79,6 +83,17 @@ archives:

checksum:
name_template: 'checksums.txt'
extra_files:
- glob: ./**.xz

snapshot:
name_template: "{{ incpatch .Version }}"

release:
# You can add extra pre-existing files to the release.
# The filename on the release will be the last part of the path (base).
# If another file with the same name exists, the last one found will be used.
#
# Templates: allowed
extra_files:
- glob: ./**.xz
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main
import (
"log"
"os"
"strconv"
"time"

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

0 comments on commit 88f7308

Please sign in to comment.