From b8d3e99686762bb4fe6e247297d420a9692875ec Mon Sep 17 00:00:00 2001 From: James Rose Date: Wed, 19 Jun 2024 01:04:13 -0400 Subject: [PATCH 1/2] Adding Matrix to CI/CD --- .github/workflows/docker-image.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c6a27562..d4e8b1cb 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,6 +6,15 @@ env: VERSION: 1.2.1 jobs: build_arm64: + strategy: + matrix: + include: + - arch: arm64 + triple: aarch64-unknown-linux-gnu + dir: arm + - arch: armhf + triple: armv7-unknown-linux-gnueabihf + dir: armhf runs-on: ubuntu-latest steps: @@ -13,22 +22,22 @@ jobs: uses: actions/checkout@v4 - name: Build the arm64 Docker image - run: docker build -t raspirus-arm -f ./docker/arm/Dockerfile . + run: docker build -t raspirus-${{ matrix.dir }} -f ./docker/${{ matrix.dir }}/Dockerfile . - name: Create the Docker container - run: docker create --name raspirus raspirus-arm + run: docker create --name raspirus raspirus-${{ matrix.dir }} - name: Create dist folder run: mkdir -p ./dist - name: Copy file from docker - run: docker cp raspirus:/usr/app/raspirus/target/aarch64-unknown-linux-gnu/release/bundle/deb/raspirus_${{ env.VERSION }}_arm64.deb ./dist + run: docker cp raspirus:/usr/app/raspirus/target/${{ matrix.triple }}/release/bundle/deb/raspirus_${{ env.VERSION }}_${{ matrix.arch }}.deb ./dist - name: Upload file to artifacts uses: actions/upload-artifact@v4 with: - name: raspirus_${{ env.VERSION }}_arm64_${{ github.run_number }}.deb - path: ./dist/raspirus_${{ env.VERSION }}_arm64.deb + name: raspirus_${{ env.VERSION }}_${{ matrix.arch}}_${{ github.run_number }}.deb + path: ./dist/raspirus_${{ env.VERSION }}_${{ matrix.arch }}.deb build_armhf: runs-on: ubuntu-latest From 6ebda2fa1541e5739fa7946e8531f43b376b0233 Mon Sep 17 00:00:00 2001 From: James Rose Date: Wed, 19 Jun 2024 01:23:23 -0400 Subject: [PATCH 2/2] Modifying workflow --- .github/workflows/docker-image.yml | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d4e8b1cb..2d6b2ef8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -39,27 +39,27 @@ jobs: name: raspirus_${{ env.VERSION }}_${{ matrix.arch}}_${{ github.run_number }}.deb path: ./dist/raspirus_${{ env.VERSION }}_${{ matrix.arch }}.deb - build_armhf: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Build the armhf Docker image - run: docker build -t raspirus-armhf -f ./docker/armhf/Dockerfile . - - - name: Create the Docker container - run: docker create --name raspirus raspirus-armhf - - - name: Create dist folder - run: mkdir -p ./dist - - - name: Copy file from docker - run: docker cp raspirus:/usr/app/raspirus/target/armv7-unknown-linux-gnueabihf/release/bundle/deb/raspirus_${{ env.VERSION }}_armhf.deb ./dist - - - name: Upload file to artifacts - uses: actions/upload-artifact@v4 - with: - name: raspirus_${{ env.VERSION }}_armhf_${{ github.run_number }}.deb - path: ./dist/raspirus_${{ env.VERSION }}_armhf.deb + # build_armhf: + # runs-on: ubuntu-latest + # + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # + # - name: Build the armhf Docker image + # run: docker build -t raspirus-armhf -f ./docker/armhf/Dockerfile . + # + # - name: Create the Docker container + # run: docker create --name raspirus raspirus-armhf + # + # - name: Create dist folder + # run: mkdir -p ./dist + # + # - name: Copy file from docker + # run: docker cp raspirus:/usr/app/raspirus/target/armv7-unknown-linux-gnueabihf/release/bundle/deb/raspirus_${{ env.VERSION }}_armhf.deb ./dist + # + # - name: Upload file to artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: raspirus_${{ env.VERSION }}_armhf_.deb + # path: ./dist/raspirus_${{ env.VERSION }}_armhf.deb