Skip to content

Commit

Permalink
[patch] 💚 Revise CI to publish extra tags
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <[email protected]>
  • Loading branch information
rinx committed Dec 11, 2020
1 parent 1213134 commit 2d31f20
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
File renamed without changes.
20 changes: 18 additions & 2 deletions .github/workflows/docker.yml → .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,19 @@ jobs:
registry: ghcr.io
username: ${{ secrets.REPOSITORY_USER }}
password: ${{ secrets.REPOSITORY_TOKEN }}
- name: extra tags
if: startsWith( github.ref, 'refs/tags/')
run: |
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
primary_name=`make docker/build/noavx/name`
secondary_name=`make docker/build/noavx/altname`
EXTRA_OPTS="-t ${primary_name}-${tag_name} -t ${secondary_name}-${tag_name}"
echo "EXTRA_OPTS=${EXTRA_OPTS}" >> $GITHUB_ENV
- name: Build
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_OPTS} --push" \
docker/build/noavx
env:
DOCKER_BUILDKIT: 1
Expand Down Expand Up @@ -87,11 +95,19 @@ jobs:
registry: ghcr.io
username: ${{ secrets.REPOSITORY_USER }}
password: ${{ secrets.REPOSITORY_TOKEN }}
- name: extra tags
if: startsWith( github.ref, 'refs/tags/')
run: |
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
primary_name=`make docker/build/avx2/name`
secondary_name=`make docker/build/avx2/altname`
EXTRA_OPTS="-t ${primary_name}-${tag_name} -t ${secondary_name}-${tag_name}"
echo "EXTRA_OPTS=${EXTRA_OPTS}" >> $GITHUB_ENV
- name: Build
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_OPTS} --push" \
docker/build/avx2
env:
DOCKER_BUILDKIT: 1
Expand Down
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ endif
DOCKER ?= docker
DOCKER_OPTS ?=

NOAVX_TAG ?= noavx
AVX2_TAG ?= avx2

NGT_BUILD_OPTIONS ?= -DNGT_AVX_DISABLED=ON

.PHONY:
Expand All @@ -50,20 +53,36 @@ docker/build: \
docker/build/noavx \
docker/build/avx2

.PHONY: docker/build/noavx/name
docker/build/noavx/name:
@echo $(ORG)/$(REPO):$(NOAVX_TAG)

.PHONY: docker/build/noavx/altname
docker/build/noavx/altname:
@echo $(ALTORG)/$(REPO):$(NOAVX_TAG)

.PHONY: docker/build/noavx
docker/build/noavx:
$(DOCKER) build \
$(DOCKER_OPTS) \
-t $(ORG)/$(REPO):noavx \
-t $(ALTORG)/$(REPO):noavx . \
-t $(ORG)/$(REPO):$(NOAVX_TAG) \
-t $(ALTORG)/$(REPO):$(NOAVX_TAG) . \
--build-arg NGT_BUILD_OPTIONS="-DNGT_AVX_DISABLED=ON"

.PHONY: docker/build/avx2/name
docker/build/avx2/name:
@echo $(ORG)/$(REPO):$(AVX2_TAG)

.PHONY: docker/build/avx2/altname
docker/build/avx2/altname:
@echo $(ALTORG)/$(REPO):$(AVX2_TAG)

.PHONY: docker/build/avx2
docker/build/avx2:
$(DOCKER) build \
$(DOCKER_OPTS) \
-t $(ORG)/$(REPO):avx2 \
-t $(ALTORG)/$(REPO):avx2 . \
-t $(ORG)/$(REPO):$(AVX2_TAG) \
-t $(ALTORG)/$(REPO):$(AVX2_TAG) . \
--build-arg NGT_BUILD_OPTIONS=""

cmd/alvd/alvd: \
Expand Down

0 comments on commit 2d31f20

Please sign in to comment.