@@ -17,47 +17,81 @@ jobs:
17
17
go-version : 1.15
18
18
- name : Unshallow
19
19
run : git fetch --prune --unshallow
20
- - name : Login do docker.io
21
- run : docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
22
- - name : Create release
23
- uses : goreleaser/goreleaser-action@v2
20
+
21
+ # - name: Create release
22
+ # uses: goreleaser/goreleaser-action@v2
23
+ # with:
24
+ # version: latest
25
+ # args: release --rm-dist
26
+ # env:
27
+ # GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
28
+
29
+ docker-release :
30
+ needs : [ release ]
31
+ runs-on : ubuntu-latest
32
+ env :
33
+ GOLANGCI_LINT_DOCKER_TOKEN : ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
34
+ steps :
35
+ - uses : actions/checkout@v2
36
+
37
+ - name : Install Go
38
+ uses : actions/setup-go@v2
24
39
with :
25
- version : latest
26
- args : release --rm-dist
27
- env :
28
- GITHUB_TOKEN : ${{ secrets.GOLANGCI_LINT_TOKEN }}
40
+ go- version : 1.15
41
+ - name : Unshallow
42
+ run : git fetch --prune --unshallow
43
+
29
44
- name : Prepare
30
45
id : prepare
31
46
run : |
32
47
TAG=${GITHUB_REF#refs/tags/}
33
48
MAJOR=${TAG%.*}
49
+ SHORT_COMMIT=${GITHUB_SHA::8}
50
+ DATE=$(date '+%Y-%m-%dT%H:%M:%SZ')
34
51
echo ::set-output name=tag_name::${TAG}
35
52
echo ::set-output name=major_tag::${MAJOR}
53
+ echo ::set-output name=short_commit::${SHORT_COMMIT}
54
+ echo ::set-output name=date::${DATE}
55
+
36
56
- name : Set up QEMU
37
57
uses : docker/setup-qemu-action@v1
58
+
38
59
- name : Set up Docker Buildx
39
60
uses : docker/setup-buildx-action@v1
40
- - name : build and publish main image
61
+
62
+ - name : Login do docker.io
63
+ run : docker login -u sayboras -p ${{ env.GOLANGCI_LINT_DOCKER_TOKEN }}
64
+
65
+ - name : Build and publish main image
41
66
id : docker_build
42
67
uses : docker/build-push-action@v2
43
68
with :
44
69
context : .
45
70
file : build/Dockerfile
46
71
platforms : linux/amd64,linux/arm64
47
72
push : true
73
+ build-args : |
74
+ VERSION=${{ steps.prepare.outputs.tag_name }}
75
+ SHORT_COMMIT=${{ steps.prepare.outputs.short_commit }}
76
+ DATE=${{ steps.prepare.outputs.date }}
48
77
tags : |
49
- golangci/golangci-lint:${{ steps.prepare.outputs.tag_name }}
50
- golangci/golangci-lint:${{ steps.prepare.outputs.major_tag }}
51
- golangci/golangci-lint:latest
52
- - name : build and publish alpine image
78
+ sayboras/golangci-lint:${{ steps.prepare.outputs.tag_name }}
79
+ sayboras/golangci-lint:${{ steps.prepare.outputs.major_tag }}
80
+ sayboras/golangci-lint:latest
81
+
82
+ - name : Build and publish alpine image
53
83
id : docker_build_alpine
54
84
uses : docker/build-push-action@v2
55
85
with :
56
86
context : .
57
87
file : build/Dockerfile.alpine
58
88
platforms : linux/amd64,linux/arm64
89
+ build-args : |
90
+ VERSION=${{ steps.prepare.outputs.tag_name }}
91
+ SHORT_COMMIT=${{ steps.prepare.outputs.short_commit }}
92
+ DATE=${{ steps.prepare.outputs.date }}
59
93
push : true
60
94
tags : |
61
- golangci /golangci-lint:${{ steps.prepare.outputs.tag_name }}-alpine
62
- golangci /golangci-lint:${{ steps.prepare.outputs.major_tag }}-alpine
63
- golangci /golangci-lint:latest-alpine
95
+ sayboras /golangci-lint:${{ steps.prepare.outputs.tag_name }}-alpine
96
+ sayboras /golangci-lint:${{ steps.prepare.outputs.major_tag }}-alpine
97
+ sayboras /golangci-lint:latest-alpine
0 commit comments