Skip to content

Commit

Permalink
chore: add build action
Browse files Browse the repository at this point in the history
  • Loading branch information
zaggash committed Dec 20, 2023
1 parent 2c5f088 commit 4e7afe0
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/run-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: Binary build

on:
push:
branches:
- main

jobs:
build:
name: RPI0 Build
runs-on: ubuntu-latest
steps:
- name: Checkout current
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
path: 'led-matrix-ui'
- name: Checkout go-rpi-rgb-led-matrix
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
repository: 'zaggash/go-rpi-rgb-led-matrix'
path: 'go-rpi-rgb-led-matrix/'
submodules: 'recursive'

- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version-file: 'led-matrix-ui/go.mod'
- name: Setup Zig
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
with:
zig-version: '0.11.0'

- name: Building rpi-rgb-led-matrix
run: |
cd go-rpi-rgb-led-matrix/lib/rpi-rgb-led-matrix/lib/
make \
CC="zig cc -target arm-linux-gnueabihf -march=arm1176jz_s -mfpu=vfp -mfloat-abi=hard" \
CXX="zig c++ -target arm-linux-gnueabihf -march=arm1176jzf_s -mfpu=vfp -mfloat-abi=hard"
- name: Building led-matrix-ui Binary
run: |
cd led-matrix-ui
./build.sh
- name: Generate Token
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.app_id }}
private_key: ${{ secrets.app_private_key }}

- name: Create release and upload artifacts
uses: ncipollo/release-action@v1
with:
token: "${{ steps.generate-token.outputs.token }}"
artifactErrorsFailBuild: true
removeArtifacts: true
allowUpdates: true
generateReleaseNotes: true
tag: latest
commit: ${{ env.GITHUB_SHA }}
name: "Latest dev build"
artifacts: "./led-matrix-ui/matrix-led-ui_armv6"
body: |
Latest Dev build
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ cd $WORKDIR/led-matrix-ui/
./build.sh
```

TODO
* Split build action with matrix to build more rpi devices
* Set variables for:
- Define Zig version
- artifact names
- CC and CXX Zig override

__Please feel free to report any issues or suggestions__

0 comments on commit 4e7afe0

Please sign in to comment.