Skip to content

Commit

Permalink
Merge pull request #801 from RoseBlume/main
Browse files Browse the repository at this point in the history
Create a matrix for the arm workflow
  • Loading branch information
Benji377 committed Jun 19, 2024
2 parents c1309b9 + 6ebda2f commit 7fbdd65
Showing 1 changed file with 38 additions and 29 deletions.
67 changes: 38 additions & 29 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,60 @@ 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:
- name: Checkout code
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

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

0 comments on commit 7fbdd65

Please sign in to comment.