Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a matrix for the arm workflow #801

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading