Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Build

Build #1274

Workflow file for this run

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:
- run: |
BOARD="${{ matrix.board }}"
NAME=${BOARD//\//_} # Replace "/" with "_"
echo "NAME=${NAME}" >> $GITHUB_ENV
- 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/merged.hex at_host-${{ env.NAME }}.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-${{ env.NAME }}.elf.sha512sum
echo "checksum=`cat at_host-${{ env.NAME }}.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-${{ env.NAME }}.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-${{ env.NAME }}-${{ 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 "[email protected]"
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