Skip to content

Commit

Permalink
Releasing docker image for arm64
Browse files Browse the repository at this point in the history
Signed-off-by: odidev <[email protected]>
  • Loading branch information
odidev committed Sep 17, 2020
1 parent 88285dc commit 6b002d5
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- v*
branches:
- master
- local_testing
pull_request:
jobs:
vulns:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- v*
branches:
- master
- local_testing
pull_request:
jobs:
# We already run the current golangci-lint in tests, but here we test
Expand Down
37 changes: 36 additions & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,47 @@ jobs:
go-version: 1.15
- name: Unshallow
run: git fetch --prune --unshallow
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
MAJOR=${TAG%.*}
echo ::set-output name=tag_name::${TAG}
echo ::set-output name=major_tag::${MAJOR}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login do docker.io
run: docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
run: docker login -u odidev -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
- name: Create release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
- name: build and publish main image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: build/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
odidev/golangci-lint:${{ steps.prepare.outputs.tag_name }}
odidev/golangci-lint:${{ steps.prepare.outputs.major_tag }}
odidev/golangci-lint:latest
- name: build and publish alpine image
id: docker_build_alpine
uses: docker/build-push-action@v2
with:
context: .
file: build/Dockerfile.alpine
platforms: linux/amd64,linux/arm64
push: true
tags: |
odidev/golangci-lint:${{ steps.prepare.outputs.tag_name }}-alpine
odidev/golangci-lint:${{ steps.prepare.outputs.major_tag }}-alpine
odidev/golangci-lint:latest-alpine
20 changes: 2 additions & 18 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project_name: golangci-lint

release:
github:
owner: golangci
owner: odidev
name: golangci-lint

builds:
Expand Down Expand Up @@ -63,25 +63,9 @@ changelog:
- Merge pull request
- Merge branch

dockers:
- dockerfile: build/Dockerfile
binaries:
- golangci-lint
image_templates:
- "golangci/golangci-lint:latest"
- "golangci/golangci-lint:{{ .Tag }}"
- "golangci/golangci-lint:v{{ .Major }}.{{ .Minor }}"
- dockerfile: build/Dockerfile.alpine
binaries:
- golangci-lint
image_templates:
- "golangci/golangci-lint:latest-alpine"
- "golangci/golangci-lint:{{ .Tag }}-alpine"
- "golangci/golangci-lint:v{{ .Major }}.{{ .Minor }}-alpine"

brews:
- tap:
owner: golangci
owner: odidev
name: homebrew-tap
folder: Formula
homepage: https://golangci.com
Expand Down
4 changes: 3 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM golang:1.15

# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
COPY golangci-lint /usr/bin/
RUN git clone https://github.com/prakriti07/golangci-lint
WORKDIR golangci-lint
RUN go build -o /usr/bin/golangci-lint ./cmd/golangci-lint/main.go
CMD ["golangci-lint"]
4 changes: 3 additions & 1 deletion build/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ FROM golang:1.15-alpine
RUN apk --no-cache add gcc musl-dev git mercurial

# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
COPY golangci-lint /usr/bin/
RUN git clone https://github.com/prakriti07/golangci-lint
WORKDIR golangci-lint
RUN CGO_ENABLED=0 go build -o /usr/bin/golangci-lint ./cmd/golangci-lint/main.go
CMD ["golangci-lint"]

0 comments on commit 6b002d5

Please sign in to comment.