0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

ci/cd: fix github workflow to upload release binaries

Fixes issue #332

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
Ramkumar Chinchani 2021-12-15 22:14:53 +00:00 committed by Ramkumar Chinchani
parent c86f44cc53
commit 50a0831f1b
2 changed files with 16 additions and 6 deletions

View file

@ -46,7 +46,7 @@ jobs:
- name: Run build and test
timeout-minutes: 30
run: |
cd $GITHUB_WORKSPACE && make
cd $GITHUB_WORKSPACE && make && make ARCH=arm64 binary-arch-minimal && make ARCH=arm64 binary-arch
env:
S3MOCK_ENDPOINT: localhost:4566
AWS_ACCESS_KEY_ID: fake
@ -57,11 +57,13 @@ jobs:
- if: github.event_name == 'release' && github.event.action == 'published'
name: Publish artifacts on releases
uses: Roang-zero1/github-upload-release-artifacts-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: svenstaro/upload-release-action@v2
with:
args: bin/zot*
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/zot*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
push-image:
if: github.event_name == 'release' && github.event.action== 'published'

View file

@ -11,7 +11,7 @@ OS ?= linux
ARCH ?= amd64
.PHONY: all
all: swagger binary binary-minimal binary-debug exporter-minimal test test-clean check
all: swagger binary binary-minimal binary-debug binary-arch binary-arch-minimal exporter-minimal test test-clean check
.PHONY: binary-minimal
binary-minimal: swagger
@ -25,6 +25,14 @@ binary: swagger
binary-debug: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-debug -tags extended,containers_image_openpgp -v -gcflags all='-N -l' -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=extended -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION}" ./cmd/zot
.PHONY: binary-arch-minimal
binary-arch-minimal: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-$(ARCH)-minimal -tags minimal,containers_image_openpgp -v -trimpath -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=minimal -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
.PHONY: binary-arch
binary-arch: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-$(ARCH) -tags extended,containers_image_openpgp -v -trimpath -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=extended -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
.PHONY: exporter-minimal
exporter-minimal: swagger
env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zot-exporter -tags minimal,containers_image_openpgp -v -trimpath ./cmd/exporter