Build ffef firmware #31
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: Build ffef firmware | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Which branch?' | |
required: true | |
default: 'nightly' | |
make_options: | |
description: 'Make Options' | |
required: true | |
default: '-j3' | |
type: choice | |
options: | |
- '-j3' | |
- '-j2' | |
- '-j1' | |
- 'V=s' | |
jobs: | |
Configcheck: | |
outputs: | |
matrix: ${{ steps.setmatrix.outputs.matrix }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Auschecken | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
submodules: true | |
- name: Konfigcheck | |
uses: nebularg/[email protected] | |
with: | |
files: site.conf | |
args: --config ./gluon/.luacheckrc | |
- name: Buildmatrix | |
id: setmatrix | |
run: | | |
ln -s ../ site | |
matrix=$( make -s list-targets BROKEN=1 | /bin/sed 's/$/"}/' | /bin/sed 's/^/{"target":"/' | /bin/sed ':a;N;$!ba;s/\n/,/g' ) | |
echo "Targets: $matrix" | |
echo "matrix={\"include\":[$(echo $matrix)]}" >> $GITHUB_OUTPUT | |
working-directory: gluon | |
build_firmware: | |
needs: Configcheck | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.Configcheck.outputs.matrix) }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Auschecken | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
submodules: true | |
- name: Permissions | |
run: chmod +x contrib/actions/run-build.sh contrib/actions/install-dependencies.sh | |
- name: Install Dependencies | |
run: sudo contrib/actions/install-dependencies.sh | |
- name: Build | |
run: | | |
mkdir output logs | |
ln -s ../ site | |
../contrib/actions/run-build.sh ${{ matrix.target }} ${{ inputs.make_options }} | |
working-directory: gluon | |
- name: Archive build logs | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }}_logs | |
path: gluon/logs | |
- name: Archive build output | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }}_output | |
path: gluon/output | |
- name: upload | |
if: github.repository == 'FreifunkErfurt/site-ffef' | |
env: | |
SSH_KEY: ${{ secrets.GITSYNC_PRIVATE_KEY }} | |
run: | | |
eval "$(ssh-agent -s)" | |
ssh-add - <<< "${SSH_KEY}" | |
rsync -avz '-e ssh -o StrictHostKeyChecking=no -p2215' gluon/output/ [email protected]:/hotfolder/${{ github.event.inputs.branch }}/ |