|
| 1 | +name: Build self hosted devices |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + DEVICE: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | +jobs: |
| 11 | + Build: |
| 12 | + runs-on: self-hosted |
| 13 | + env: |
| 14 | + CCACHE_DIR: $HOME/ccache-${{ inputs.DEVICE }} |
| 15 | + CCACHE_SLOPPINESS: pch_defines,time_macros |
| 16 | + SOURCES_DIR: /opt/rocknix-sources |
| 17 | + steps: |
| 18 | + - name: Fix permissions |
| 19 | + run: | |
| 20 | + chmod -R u+rwX $GITHUB_WORKSPACE/build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/build/syncthing-* || true |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + - name: Build |
| 25 | + uses: corrupt952/[email protected] |
| 26 | + with: |
| 27 | + command: | |
| 28 | + CCACHE_DIR=$HOME/ccache-${{ inputs.DEVICE }} ccache --max-size=20G |
| 29 | + CCACHE_DIR=$HOME/ccache-${{ inputs.DEVICE }} ccache --set-config sloppiness=pch_defines,time_macros |
| 30 | + set -o pipefail |
| 31 | + make ${{ inputs.DEVICE }} | tee output.log | grep -E --color=never --line-buffered "^GET|^UNPACK|^BUILD|^INSTALL" |
| 32 | + exit ${PIPESTATUS[0]} |
| 33 | + max_attempts: 4 |
| 34 | + retry_interval: 10 |
| 35 | + |
| 36 | + - name: Archive output.logs (${{ inputs.DEVICE }}-aarch64) |
| 37 | + if: failure() |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: output.logs-${{ inputs.DEVICE }}-aarch64 |
| 41 | + path: | |
| 42 | + output.log |
| 43 | + ./build.ROCKNIX-${{ inputs.DEVICE }}.aarch64/.threads/logs/ |
| 44 | + - name: Get date |
| 45 | + run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV |
| 46 | + |
| 47 | + - uses: actions/upload-artifact@v4 |
| 48 | + with: |
| 49 | + name: ROCKNIX-image-${{ inputs.DEVICE }}-${{ env.DATE }} |
| 50 | + path: | |
| 51 | + target/ROCKNIX-*.img.gz |
| 52 | + target/ROCKNIX-*.img.gz.sha256 |
| 53 | + compression-level: 0 |
| 54 | + if-no-files-found: error |
| 55 | + |
| 56 | + - uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: ROCKNIX-update-${{ inputs.DEVICE }}-${{ env.DATE }} |
| 59 | + path: | |
| 60 | + target/ROCKNIX-*.tar |
| 61 | + target/ROCKNIX-*.tar.sha256 |
| 62 | + compression-level: 0 |
| 63 | + if-no-files-found: error |
0 commit comments