Skip to content

Commit

Permalink
CI: nicer goreleaser usage
Browse files Browse the repository at this point in the history
  • Loading branch information
aidansteele committed Jan 2, 2020
1 parent 00d3471 commit fb4b862
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x

- name: goreleaser
uses: ./
env:
GORELEASER_GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
uses: goreleaser/goreleaser-action@v1
with:
args: sh -c "GITHUB_TOKEN=$GORELEASER_GITHUB_TOKEN goreleaser"
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
23 changes: 3 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
FROM golang:1.12-alpine AS deps
RUN apk add --update git upx curl
RUN curl -o gor.tgz -L https://github.com/goreleaser/goreleaser/releases/download/v0.106.0/goreleaser_Linux_x86_64.tar.gz
RUN tar -xvf gor.tgz && mv goreleaser /usr/bin

ENV CGO_ENABLED=0

WORKDIR /wd
COPY go.mod go.sum ./
RUN go mod download

FROM deps AS builder
COPY . .
RUN go build -ldflags="-s -w"
RUN upx stackit

FROM alpine
RUN apk add --update --no-cache ca-certificates
COPY --from=builder /wd/stackit /usr/bin
CMD ["/usr/bin/stackit"]
FROM gcr.io/distroless/static
COPY stackit /
CMD ["/stackit"]

0 comments on commit fb4b862

Please sign in to comment.