diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d0674b..c2311aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,15 +11,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Installing dependencies run: | sudo apt update && sudo apt install make -y - git clone https://github.com/estesp/manifest-tool && cd manifest-tool && git checkout v0.9.0 && sudo make && sudo make install && cd .. && rm -Rf manifest-tool - docker run --rm --privileged multiarch/qemu-user-static:register - sudo apt install -y qemu qemu-user-static qemu-user binfmt-support echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_LOGIN }}" --password-stdin + - name: install buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v1 - name: Build image run: make build-docker - name: Publish image - run: make publish-docker latest + run: make publish-docker diff --git a/Dockerfile b/Dockerfile index a405142..b0c0b8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,6 @@ -FROM python:alpine3.11 as builder +FROM python:alpine -COPY qemu-*-static /usr/bin/ - -FROM builder - -LABEL maintainer="Jay MOULIN " +LABEL maintainer="Jay MOULIN " RUN pip install google-closure-compiler-api COPY ./entrypoint.sh /bin/entrypoint diff --git a/Makefile b/Makefile index 3bea0d7..49787ca 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ VERSION ?= 0.1.5 CACHE ?= --no-cache=1 -FULLVERSION ?= 0.1.5 -archs ?= amd64 i386 arm64v8 arm32v6 -.PHONY: docker build-docker publish-docker latest +.PHONY: docker build-docker publish-docker test: install twine upload -r testpypi dist/* publish: install @@ -19,19 +17,10 @@ dist: clean: build dist sudo rm -Rf build/* sudo rm -Rf dist/* -docker: build-docker publish-docker latest + +docker: build-docker publish-docker build-docker: - cp /usr/bin/qemu-*-static . - $(foreach arch,$(archs), \ - cat Dockerfile | sed "s/FROM python:alpine/FROM ${arch}\/python:alpine/g" > .Dockerfile; \ - docker build -t femtopixel/google-closure-compiler:${VERSION}-$(arch) -f .Dockerfile ${CACHE} .;\ - ) + docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64,linux/386,linux/arm/v6 ${PUSH} --tag femtopixel/google-closure-compiler --tag femtopixel/google-closure-compiler:${VERSION} ${CACHE} . publish-docker: - docker push femtopixel/google-closure-compiler -a - cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest.yaml - cat manifest.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}/g" > manifest2.yaml - mv manifest2.yaml manifest.yaml - manifest-tool push from-spec manifest.yaml -latest: build-docker - FULLVERSION=latest VERSION=${VERSION} make publish-docker + PUSH=--push CACHE= make build diff --git a/manifest.yml b/manifest.yml deleted file mode 100644 index 7bdc377..0000000 --- a/manifest.yml +++ /dev/null @@ -1,23 +0,0 @@ -image: femtopixel/google-closure-compiler:$FULLVERSION -manifests: - - - image: femtopixel/google-closure-compiler:$VERSION-arm32v6 - platform: - architecture: arm - variant: v6 - os: linux - - - image: femtopixel/google-closure-compiler:$VERSION-arm64v8 - platform: - architecture: arm64 - os: linux - - - image: femtopixel/google-closure-compiler:$VERSION-amd64 - platform: - architecture: amd64 - os: linux - - - image: femtopixel/google-closure-compiler:$VERSION-i386 - platform: - architecture: 386 - os: linux diff --git a/setup.cfg b/setup.cfg index 5aef279..ddb7da9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.rst +description_file = README.rst