update nerves github action #2
Workflow file for this run
This file contains 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: nerves | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
firmware: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./nerves_fw | |
strategy: | |
max-parallel: 1 # mix nerves_hub.firmware publish does not work on parallel uploads | |
matrix: | |
target: [ex_nvr_rpi4, ex_nvr_rpi5] | |
env: | |
MIX_ENV: prod | |
MIX_TARGET: ${{ matrix.target }} | |
NERVES_HUB_PRODUCT_KEY: ${{ secrets.NERVES_HUB_PRODUCT_KEY }} | |
NERVES_HUB_PRODUCT_SECRET: ${{ secrets.NERVES_HUB_PRODUCT_SECRET }} | |
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }} | |
REMOTE_CONFIGURER_URL: ${{ vars.REMOTE_CONFIGURER_URL }} | |
REMOTE_CONFIGURER_TOKEN: ${{ secrets.REMOTE_CONFIGURER_TOKEN }} | |
REMOTE_CONFIGURER_VERSION: ${{ vars.REMOTE_CONFIGURER_VERSION }} | |
NH_TOKEN: ${{ secrets.NH_TOKEN }} | |
NERVES_HUB_URI: ${{ vars.NERVES_HUB_URI }} | |
NERVES_HUB_ORG: ${{ vars.NERVES_HUB_ORG }} | |
NERVES_HUB_PRODUCT: ${{ vars.NERVES_HUB_PRODUCT }} | |
NERVES_HUB_NON_INTERACTIVE: true | |
NERVES_FIRMWARE_SIGNING_KEY: ${{ secrets.NERVES_FIRMWARE_SIGNING_KEY }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: erlef/[email protected] | |
with: | |
otp-version: 27.2 | |
elixir-version: 1.17.3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get -y install npm wget build-essential automake autoconf git squashfs-tools ssh-askpass \ | |
pkg-config curl libmnl-dev libssl-dev libncurses5-dev help2man libconfuse-dev \ | |
libarchive-dev libsrtp2-dev libturbojpeg-dev | |
- name: Install fwup | |
run: | | |
wget https://github.com/fwup-home/fwup/releases/download/v1.11.0/fwup_1.11.0_amd64.deb && \ | |
sudo dpkg -i fwup_1.11.0_amd64.deb && \ | |
rm fwup_1.11.0_amd64.deb | |
- name: Install Nerves | |
run: | | |
mix local.hex --force && \ | |
mix local.rebar --force && \ | |
mix archive.install hex nerves_bootstrap --force | |
- name: Build assets | |
run: mix do deps.get, cmd --cd assets npm install, assets.deploy | |
working-directory: ./ui | |
- name: Download firmware dependencies | |
run: mix do deps.get, firmware.deps | |
- name: Create firmware | |
run: mix firmware | |
- name: Sign firmware | |
run: | | |
fwup -S --private-key ${{ env.NERVES_FIRMWARE_SIGNING_KEY }} -i _build/${{ env.MIX_TARGET }}_${{ env.MIX_ENV}}/nerves/images/ex_nvr_fw.fw -o ex_nvr_fw.fw | |
- name: Upload to Nerves hub | |
run: mix nerves_hub.firmware publish --product ${{ env.NERVES_HUB_PRODUCT }} ex_nvr_fw.fw |