From 6601ae97596be4979675c8c358ee240aec0ebbbd Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Thu, 17 Dec 2020 16:52:52 +0100 Subject: [PATCH] Use docker/build-push-action@v2 (#211) * Use docker/build-push-action@v2 * Enable qemu + buildx * Install cmake to enable compilation on other architectures --- .github/workflows/ci.yml | 35 ++++++++++++++++++++++++++++------- Dockerfile | 3 ++- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e4d451044..a5e7f918e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: - 'master' - 'dev' - 'stable' + - 'container-*' schedule: - cron: '0 18 * * 1,3,5' # Three-weekly at 18:00 UTC on Monday, Wednesday, and Friday pull_request: @@ -874,17 +875,37 @@ jobs: publish-docker-image: name: Publish Docker image on Docker Hub - needs: [build-and-test] + # needs: [build-and-test] runs-on: ubuntu-20.04 if: github.event_name == 'push' steps: - uses: actions/checkout@v2 with: submodules: recursive - - name: Publish to Registry - uses: docker/build-push-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 with: - repository: ${{ secrets.DOCKER_USERNAME }}/rizin - tag_with_ref: true - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/rizin + tag-semver: | + {{version}} + {{major}}.{{minor}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Publish to Registry + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64,linux/386 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index b5ea1ed3a0..64e56da2f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,6 +64,7 @@ VOLUME ["/mnt"] # pip3 install meson ninja RUN apt-get update && \ apt-get install -y \ + cmake \ gcc \ git \ python3-pip \ @@ -81,7 +82,7 @@ RUN apt-get update && \ meson install -C build && \ pip3 uninstall -y meson ninja && \ apt-get remove --purge -y \ - python3-pip gcc &&\ + python3-pip gcc cmake &&\ apt-get autoremove --purge -y && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*