File tree Expand file tree Collapse file tree 2 files changed +76
-2
lines changed
Expand file tree Collapse file tree 2 files changed +76
-2
lines changed Original file line number Diff line number Diff line change 1616 - name : acceptance-test
1717 run : make docker-acceptance
1818
19+ - name : build-image
20+ run : make docker-image
21+
22+ - name : save image
23+ run : make save-image
24+
25+ - name : archive image
26+ uses : actions/upload-artifact@v2
27+ with :
28+ name : kubeconform-image
29+ path : kubeconform-image.tar
30+
31+ publish-image-master :
32+ runs-on : ubuntu-latest
33+ if : github.ref == 'refs/heads/master'
34+ needs : test
35+ steps :
36+ - name : checkout
37+ uses : actions/checkout@v2
38+
39+ - name : Download kubeconform image
40+ uses : actions/download-artifact@v2
41+ with :
42+ name : kubeconform-image
43+
44+ - name : load image
45+ run : docker load < kubeconform-image.tar
46+
47+ - name : push
48+ run : |
49+ echo "${{ github.token }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
50+ make push-image
51+ env :
52+ RELEASE_VERSION : master
53+
54+ publish-image-release :
55+ runs-on : ubuntu-latest
56+ if : startsWith(github.ref, 'refs/tags/v')
57+ needs : test
58+ steps :
59+ - name : checkout
60+ uses : actions/checkout@v2
61+
62+ - name : Download kubeconform image
63+ uses : actions/download-artifact@v2
64+ with :
65+ name : kubeconform-image
66+
67+ - name : load image
68+ run : docker load < kubeconform-image.tar
69+
70+ - name : Set env
71+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
72+
73+ - name : push-tag
74+ run : |
75+ echo "${{ github.token }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
76+ make push-image
77+
78+ - name : push-latest
79+ run : |
80+ make push-image
81+ env :
82+ RELEASE_VERSION : latest
83+
1984 goreleaser :
2085 runs-on : ubuntu-latest
2186 needs : test
Original file line number Diff line number Diff line change 11# !/usr/bin/make -f
22
3+ RELEASE_VERSION ?= latest
4+
35.PHONY : test-build test build build-static docker-test docker-build-static build-bats docker-acceptance docker-image release
46
57test-build : test build
@@ -11,10 +13,17 @@ build:
1113 go build -o bin/ ./...
1214
1315docker-image :
14- docker build -t kubeconform .
16+ docker build -t kubeconform:${RELEASE_VERSION} .
17+
18+ save-image :
19+ docker save --output kubeconform-image.tar kubeconform:${RELEASE_VERSION}
20+
21+ push-image :
22+ docker tag kubeconform:latest docker.pkg.github.com/yannh/kubeconform/kubeconform:${RELEASE_VERSION}
23+ docker push docker.pkg.github.com/yannh/kubeconform/kubeconform:${RELEASE_VERSION}
1524
1625build-static :
17- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/ ./...
26+ CGO_ENABLED=0 GOFLAGS=-mod=vendor GOOS=linux GOARCH=amd64 GO111MODULE=on go build -trimpath -tags=netgo -ldflags " -extldflags= \" -static \" " -a -o bin/ ./...
1827
1928docker-test :
2029 docker run -t -v $$ PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.14 make test
You can’t perform that action at this time.
0 commit comments