This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
Build #1212
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 | |
on: | |
push: | |
branches-ignore: | |
- gh-pages | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
board: | |
- thingy91x_nrf9151_ns | |
- thingy91_nrf9160_ns | |
- nrf9160dk_nrf9160_ns | |
- nrf9161dk_nrf9161_ns | |
steps: | |
- name: Build AT host sample | |
run: | | |
docker run --rm \ | |
-v ${PWD}:/workdir/project \ | |
-w /workdir/nrf/samples/cellular/at_client \ | |
nordicplayground/nrfconnect-sdk:main \ | |
west build -p always -b ${{ matrix.board }} --build-dir /workdir/project/build | |
cp build/zephyr/merged.hex at_host-${{ matrix.board }}.hex | |
# Ensure that the new build actually contains updated code, | |
# otherwise do not push a new release for this HEX file | |
- name: Calculate new checksum | |
id: new-checksum | |
run: | | |
sha512sum build/zephyr/zephyr.elf | cut -d " " -f 1 | tr -d '\n' > at_host-${{ matrix.board }}.elf.sha512sum | |
echo "checksum=`cat at_host-${{ matrix.board }}.elf.sha512sum`" >> $GITHUB_OUTPUT | |
- name: Get Current checksum | |
id: current-checksum | |
continue-on-error: true | |
run: | | |
CHECKSUM=$(curl -q --fail https://nordicsemiconductor.github.io/at_host-hex/at_host-${{ matrix.board }}.elf.sha512sum) | |
echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT | |
- uses: actions/upload-artifact@v4 | |
if: steps.current-checksum.outcome == 'failure' || steps.new-checksum.outputs.checksum != steps.current-checksum.outputs.checksum | |
with: | |
if-no-files-found: error | |
name: at_host-${{ matrix.board }}-${{ github.sha }} | |
path: | | |
at_host-*.hex | |
at_host-*.elf.sha512sum | |
publish: | |
needs: [build] | |
runs-on: ubuntu-22.04 | |
if: github.ref == 'refs/heads/saga' | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Publish HEX files | |
run: | | |
echo "machine github.com login accesskey password ${GITHUB_TOKEN}" > ~/.netrc | |
git config --global user.email "actions@example.com" | |
git config --global user.name "github-actions[bot]" | |
git clone https://github.com/${GITHUB_REPOSITORY}.git --branch gh-pages public | |
for folder in $(find ./ -type d -name 'at_host-*'); do cp ./${folder}/* public; done | |
cd public | |
git add -A | |
if git diff-index --quiet HEAD --; then echo "Nothing changed."; exit 0; fi | |
git commit -m "Update HEX files" | |
git push -f origin HEAD:gh-pages |