Skip to content

Commit 6b002d5

Browse files
committed
Releasing docker image for arm64
Signed-off-by: odidev <[email protected]>
1 parent 88285dc commit 6b002d5

File tree

6 files changed

+46
-21
lines changed

6 files changed

+46
-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+
- local_testing
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+
- local_testing
910
pull_request:
1011
jobs:
1112
# We already run the current golangci-lint in tests, but here we test

.github/workflows/tag.yml

+36-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,47 @@ jobs:
1717
go-version: 1.15
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 QEMU
28+
uses: docker/setup-qemu-action@v1
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v1
2031
- name: Login do docker.io
21-
run: docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
32+
run: docker login -u odidev -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
2233
- name: Create release
2334
uses: goreleaser/goreleaser-action@v2
2435
with:
2536
version: latest
2637
args: release --rm-dist
2738
env:
2839
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
40+
- name: build and publish main image
41+
id: docker_build
42+
uses: docker/build-push-action@v2
43+
with:
44+
context: .
45+
file: build/Dockerfile
46+
platforms: linux/amd64,linux/arm64
47+
push: true
48+
tags: |
49+
odidev/golangci-lint:${{ steps.prepare.outputs.tag_name }}
50+
odidev/golangci-lint:${{ steps.prepare.outputs.major_tag }}
51+
odidev/golangci-lint:latest
52+
- name: build and publish alpine image
53+
id: docker_build_alpine
54+
uses: docker/build-push-action@v2
55+
with:
56+
context: .
57+
file: build/Dockerfile.alpine
58+
platforms: linux/amd64,linux/arm64
59+
push: true
60+
tags: |
61+
odidev/golangci-lint:${{ steps.prepare.outputs.tag_name }}-alpine
62+
odidev/golangci-lint:${{ steps.prepare.outputs.major_tag }}-alpine
63+
odidev/golangci-lint:latest-alpine

.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.15
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/prakriti07/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.15-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/prakriti07/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)