feat(debian): use docker/buid-push-action #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Debian Packages | |
| on: [push] | |
| jobs: | |
| debian-build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-24.04 | |
| arch: amd64 | |
| base_image: debian:trixie-slim | |
| - runner: ubuntu-24.04-arm | |
| arch: arm64 | |
| base_image: debian:trixie-slim | |
| - runner: ubuntu-24.04-riscv | |
| arch: riscv64 | |
| base_image: ubuntu:noble | |
| runs-on: ${{ matrix.runner }} | |
| name: Debian Build | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Checkout machine emulator source code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| - name: Import GPG signing key | |
| working-directory: debian | |
| env: | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| run: | | |
| mkdir -p key | |
| chmod 700 key | |
| echo "$GPG_PRIVATE_KEY" | base64 -d | gpg --homedir "$(pwd)/key" --import | |
| - name: Setup up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Make builder container image | |
| uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 | |
| with: | |
| context: debian | |
| file: debian/Dockerfile | |
| platforms: linux/${{ matrix.arch }} | |
| build-args: BASE_IMAGE=${{ matrix.base_image }} | |
| tags: cartesi/deb-builder-${{ matrix.arch }} | |
| load: true | |
| push: false | |
| cache-from: type=gha,scope=${{ matrix.arch }} | |
| cache-to: type=gha,scope=${{ matrix.arch }},mode=max | |
| - name: Build packages | |
| working-directory: debian | |
| run: make packages TARGET_ARCH=${{ matrix.arch }} | |
| - name: Export builder container image | |
| run: docker save cartesi/deb-builder-${{ matrix.arch }} | gzip > /tmp/deb-builder-${{ matrix.arch }}.tar.gz | |
| - name: Upload builder container image | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: image-deb-builder-${{ matrix.arch }} | |
| path: /tmp/deb-builder-${{ matrix.arch }}.tar.gz | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: artifacts-apt-${{ matrix.arch }} | |
| path: cdn/apt |