Skip to content

devsync 06d5cd8

devsync 06d5cd8 #570

Workflow file for this run

name: PlatformIO CI
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: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: build_SC_DSM0
run: |
set -x
git submodule update --init
pio pkg install --environment SC_DSM0
pio run -v --environment SC_DSM0
pio run -v --environment SC_DSM0 -t upload || true
hex=$(echo .pio/build/*/*.hex)
rm -f $hex;
mv .pio/build/*/*.eh2k $hex;
- name: build_OC_T40
run: |
git submodule update --init
pio run --environment OC_T40
- name: pack_artifacts
run: |
export hash=$(git rev-parse --short HEAD)
mv .github/workflows/LICENSE.txt ./LICENSE.txt
for f in .pio/build/*/*.hex; do
FIRMWARE=$(basename $(dirname ${f%.*}))
HEX_FILE=./firmware_${FIRMWARE}_$hash.hex
ZIP_FILE=./firmware_${FIRMWARE}_$hash.zip
mv -v "$f" $HEX_FILE
zip -j $ZIP_FILE $HEX_FILE ./LICENSE.txt
sha256sum $ZIP_FILE
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/${FIRMWARE}_latest.zip --upload-file $ZIP_FILE || true
curl -fs -X PUT -u ${{ secrets.UPLOAD_KEY }} ${{ secrets.LATEST_DROP_FOLDER }}/${FIRMWARE}_latest.sha -d "$hash"
done