devsync 2cd9d0a #611
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] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: codeberg_sync | |
run: | | |
git remote add --mirror=fetch secondary https://${{ secrets.CODEBERG_AUTH }}@codeberg.org/eh2k/squares-and-circles.git | |
git fetch origin | |
git push secondary --all --force | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: build | |
run: | | |
set -x | |
python -m pip install --upgrade pip | |
curl -fLO https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.3.1-2.1/xpack-arm-none-eabi-gcc-10.3.1-2.1-linux-x64.tar.gz | |
cat xpack-arm-none-eabi-gcc-10.3.1-2.1-linux-x64.tar.gz | tar xvz -C . > /dev/null | |
export GCC_PATH=/$(realpath .)/xpack-arm-none-eabi-gcc-10.3.1-2.1/bin/ | |
export PATH="${PATH}:/$(realpath .)/xpack-arm-none-eabi-gcc-10.3.1-2.1/bin/" | |
arm-none-eabi-gcc --version | |
pip install intelhex subprocess32 pyelftools Jinja2 platformio | |
find ./app -type f -name *.bin -exec touch {} + | |
git submodule update --init | |
sh ./app/build.sh | |
git status | |
- name: pack_artifacts | |
run: | | |
export hash=$(git rev-parse --short HEAD) | |
for f in .pio/build/*/*.hex; do | |
FIRMWARE=$(basename $(dirname ${f%.*})) | |
HEX_FILE=./${FIRMWARE}_engines_$hash.hex | |
ZIP_FILE=./${FIRMWARE}_engines_$hash.zip | |
mv -v "$f" $HEX_FILE | |
zip -j -9 $ZIP_FILE $HEX_FILE .github/workflows/LICENSE.txt $(dirname ${f%.*})/loader.sha | |
sha256sum $ZIP_FILE | |
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/$ZIP_FILE --upload-file $ZIP_FILE || true | |
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/${FIRMWARE}_latest.sha -d "$hash" | |
done |