Skip to content

Commit cf45b63

Browse files
committed
Releasing docker image for arm64
Signed-off-by: odidev <[email protected]>
1 parent 20814be commit cf45b63

File tree

6 files changed

+49
-21
lines changed

6 files changed

+49
-21
lines changed

.github/workflows/pr-extra.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
- v*
66
branches:
77
- master
8+
- arm_support
89
pull_request:
910
jobs:
1011
vulns:

.github/workflows/pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- v*
77
branches:
88
- master
9+
- arm_support
910
pull_request:
1011
jobs:
1112
# We already run the current golangci-lint in tests, but here we test

.github/workflows/tag.yml

+39-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,50 @@ jobs:
1717
go-version: 1.14
1818
- name: Unshallow
1919
run: git fetch --prune --unshallow
20+
- name: Prepare
21+
id: prepare
22+
run: |
23+
TAG=${GITHUB_REF#refs/tags/}
24+
MAJOR=${TAG%.*}
25+
echo ::set-output name=tag_name::${TAG}
26+
echo ::set-output name=major_tag::${MAJOR}
27+
- name: set up buildx
28+
id: buildx
29+
uses: crazy-max/ghaction-docker-buildx@v1
30+
with:
31+
version: latest
2032
- name: Login do docker.io
21-
run: docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
33+
run: docker login -u odidev -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
2234
- name: Create release
2335
uses: goreleaser/goreleaser-action@v2
2436
with:
2537
version: latest
2638
args: release --rm-dist
2739
env:
2840
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
41+
- name: build (and publish) main image
42+
env:
43+
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
44+
run: |
45+
docker buildx build \
46+
--platform linux/amd64,linux/arm64 \
47+
--build-arg VERSION=${{ steps.prepare.outputs.tag_name }} \
48+
--push \
49+
-t ${DOCKER_REPO:-odidev/golangci-lint}:${{ steps.prepare.outputs.tag_name }} \
50+
-t ${DOCKER_REPO:-odidev/golangci-lint}:${{ steps.prepare.outputs.major_tag }} \
51+
-t ${DOCKER_REPO:-odidev/golangci-lint}:latest \
52+
-f build/Dockerfile \
53+
.
54+
- name: build (and publish) alpine image
55+
env:
56+
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
57+
run: |
58+
docker buildx build \
59+
--platform linux/amd64,linux/arm64 \
60+
--build-arg VERSION=${{ steps.prepare.outputs.tag_name }} \
61+
--push \
62+
-t ${DOCKER_REPO:-odidev/golangci-lint}:${{ steps.prepare.outputs.tag_name }}-alpine \
63+
-t ${DOCKER_REPO:-odidev/golangci-lint}:${{ steps.prepare.outputs.major_tag }}-alpine \
64+
-t ${DOCKER_REPO:-odidev/golangci-lint}:latest-alpine \
65+
-f build/Dockerfile.alpine \
66+
.

.goreleaser.yml

+2-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project_name: golangci-lint
33

44
release:
55
github:
6-
owner: golangci
6+
owner: odidev
77
name: golangci-lint
88

99
builds:
@@ -63,25 +63,9 @@ changelog:
6363
- Merge pull request
6464
- Merge branch
6565

66-
dockers:
67-
- dockerfile: build/Dockerfile
68-
binaries:
69-
- golangci-lint
70-
image_templates:
71-
- "golangci/golangci-lint:latest"
72-
- "golangci/golangci-lint:{{ .Tag }}"
73-
- "golangci/golangci-lint:v{{ .Major }}.{{ .Minor }}"
74-
- dockerfile: build/Dockerfile.alpine
75-
binaries:
76-
- golangci-lint
77-
image_templates:
78-
- "golangci/golangci-lint:latest-alpine"
79-
- "golangci/golangci-lint:{{ .Tag }}-alpine"
80-
- "golangci/golangci-lint:v{{ .Major }}.{{ .Minor }}-alpine"
81-
8266
brews:
8367
- tap:
84-
owner: golangci
68+
owner: odidev
8569
name: homebrew-tap
8670
folder: Formula
8771
homepage: https://golangci.com

build/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM golang:1.14
22

33
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
4-
COPY golangci-lint /usr/bin/
4+
RUN git clone https://github.com/odidev/golangci-lint
5+
WORKDIR golangci-lint
6+
RUN go build -o /usr/bin/golangci-lint ./cmd/golangci-lint/main.go
57
CMD ["golangci-lint"]

build/Dockerfile.alpine

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ FROM golang:1.14-alpine
66
RUN apk --no-cache add gcc musl-dev git mercurial
77

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

0 commit comments

Comments
 (0)