Skip to content

Commit 2fc9fa5

Browse files
authored
Upgraded to go version 1.20, added version to release artifacts and reduced final artifact sizes (#13)
1 parent 9da6fbe commit 2fc9fa5

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
contents: write
1818

1919
jobs:
20-
goreleaser:
20+
build:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout

.goreleaser.yaml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
1-
before:
2-
hooks:
3-
- go mod download
4-
51
builds:
62
- env:
3+
# goreleaser does not work with CGO, it could also complicate
4+
# usage by users in CI/CD systems like Terraform Cloud where
5+
# they are unable to install libraries.
76
- CGO_ENABLED=0
8-
- GO111MODULE=on
7+
mod_timestamp: '{{ .CommitTimestamp }}'
98
goos:
10-
- linux
11-
- windows
129
- darwin
1310
- freebsd
14-
- openbsd
15-
- netbsd
11+
- windows
12+
- linux
1613
goarch:
1714
- amd64
1815
- '386'
1916
- arm
2017
- arm64
21-
- s390x
22-
23-
source:
24-
enabled: true
25-
name_template: 'sources'
18+
ldflags:
19+
# -s Omit the symbol table and debug information
20+
# -w Omit the DWARF symbol table
21+
# -X importpath.name=value # set the value of the string variable in importpath named name to value
22+
# Someday we could implement a "version" command and set the version like this:
23+
# - '-s -w -X "github.com/cloudposse/slack-notifier/cmd.Version={{.Env.GORELEASER_CURRENT_TAG}}"'
24+
- '-s -w'
2625

2726
archives:
2827
- format: binary
29-
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
28+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
3029

3130
checksum:
32-
name_template: 'checksums.txt'
31+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
32+
algorithm: sha256
33+
34+
release:
35+
# If you want to manually examine the release before it is live, uncomment this line:
36+
# draft: true
3337

34-
snapshot:
35-
name_template: "{{ incpatch .Version }}"
38+
changelog:
39+
skip: true

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM golang:1.13.3-buster as builder
1+
FROM golang:1.20.3-bullseye as builder
22
ENV GO111MODULE=on
33
ENV CGO_ENABLED=0
44
WORKDIR /usr/src/
55
COPY . /usr/src
66
RUN go build -v -o "bin/slack-notifier" *.go
77

8-
FROM alpine:3.12
8+
FROM alpine:3.17
99
RUN apk add --no-cache ca-certificates
1010
COPY --from=builder /usr/src/bin/* /usr/bin/
1111
ENV PATH $PATH:/usr/bin

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/cloudposse/slack-notifier
22

3-
go 1.13
3+
go 1.20

0 commit comments

Comments
 (0)