Skip to content

Commit

Permalink
Upgraded to go version 1.20, added version to release artifacts and r…
Browse files Browse the repository at this point in the history
…educed final artifact sizes (#13)
  • Loading branch information
zdmytriv authored Apr 14, 2023
1 parent 9da6fbe commit 2fc9fa5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
contents: write

jobs:
goreleaser:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
40 changes: 22 additions & 18 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
before:
hooks:
- go mod download

builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
- GO111MODULE=on
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
- windows
- darwin
- freebsd
- openbsd
- netbsd
- windows
- linux
goarch:
- amd64
- '386'
- arm
- arm64
- s390x

source:
enabled: true
name_template: 'sources'
ldflags:
# -s Omit the symbol table and debug information
# -w Omit the DWARF symbol table
# -X importpath.name=value # set the value of the string variable in importpath named name to value
# Someday we could implement a "version" command and set the version like this:
# - '-s -w -X "github.com/cloudposse/slack-notifier/cmd.Version={{.Env.GORELEASER_CURRENT_TAG}}"'
- '-s -w'

archives:
- format: binary
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'

checksum:
name_template: 'checksums.txt'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256

release:
# If you want to manually examine the release before it is live, uncomment this line:
# draft: true

snapshot:
name_template: "{{ incpatch .Version }}"
changelog:
skip: true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.13.3-buster as builder
FROM golang:1.20.3-bullseye as builder
ENV GO111MODULE=on
ENV CGO_ENABLED=0
WORKDIR /usr/src/
COPY . /usr/src
RUN go build -v -o "bin/slack-notifier" *.go

FROM alpine:3.12
FROM alpine:3.17
RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/src/bin/* /usr/bin/
ENV PATH $PATH:/usr/bin
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/cloudposse/slack-notifier

go 1.13
go 1.20

0 comments on commit 2fc9fa5

Please sign in to comment.