|
47 | 47 | - name: Checkout |
48 | 48 | uses: actions/checkout@v2 |
49 | 49 | - id: set-targets |
50 | | - run: echo "::set-output name=targets::[$( (grep -r "\[env:.*STLINK\]" src/targets/ ; grep "\[env:.*UART\]" src/targets/unified.ini) | sed 's/.*://' | sed s/.$// | egrep "(STLINK|UART)" | grep -v DEPRECATED | tr '\n' ',' | sed 's/,$/"\n/' | sed 's/,/","/'g | sed 's/^/"/')]" |
| 50 | + run: echo "::set-output name=targets::[$( (grep "\[env:.*UART\]" src/targets/unified.ini ; grep -r "\[env:.*STLINK\]" src/targets/) | sed 's/.*://' | sed s/.$// | egrep "(STLINK|UART)" | grep -v DEPRECATED | tr '\n' ',' | sed 's/,$/"\n/' | sed 's/,/","/'g | sed 's/^/"/')]" |
51 | 51 |
|
52 | 52 | build: |
53 | 53 | needs: targets |
@@ -89,35 +89,85 @@ jobs: |
89 | 89 | run: | |
90 | 90 | platformio platform update |
91 | 91 | platformio platform install native |
92 | | - mkdir -p ~/artifacts |
| 92 | + mkdir -p ~/artifacts/firmware |
93 | 93 | cd src |
94 | 94 | case ${{matrix.target}} in |
95 | 95 | *2400* | FM30*) |
96 | 96 | # release builds |
97 | | - PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_EU_CE_2400 -DUSE_DIVERSITY" pio run -e ${{ matrix.target }} |
98 | | - mkdir ~/artifacts/LBT/ |
99 | | - mv .pio/build/${{ matrix.target }} ~/artifacts/LBT/`echo ${{ matrix.target }} | sed s/_via.*//` |
100 | | - PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400 -DUSE_DIVERSITY" pio run -e ${{ matrix.target }} |
101 | | - mkdir ~/artifacts/FCC/ |
102 | | - mv .pio/build/${{ matrix.target }} ~/artifacts/FCC/`echo ${{ matrix.target }} | sed s/_via.*//` |
| 97 | + PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_EU_CE_2400" pio run -e ${{ matrix.target }} |
| 98 | + OUTDIR=~/artifacts/firmware/LBT/`echo ${{ matrix.target }} | sed s/_via.*//` |
| 99 | + mkdir -p $OUTDIR |
| 100 | + mv .pio/build/${{ matrix.target }}/firmware.{elrs,bin} $OUTDIR >& /dev/null || : |
| 101 | +
|
| 102 | + PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400" pio run -e ${{ matrix.target }} |
| 103 | + OUTDIR=~/artifacts/firmware/FCC/`echo ${{ matrix.target }} | sed s/_via.*//` |
| 104 | + mkdir -p $OUTDIR |
| 105 | + mv .pio/build/${{ matrix.target }}/firmware.{elrs,bin} $OUTDIR >& /dev/null || : |
103 | 106 | ;; |
104 | 107 | *) |
105 | 108 | # release build |
106 | | - PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_FCC_915 -DUSE_DIVERSITY" pio run -e ${{ matrix.target }} |
107 | | - mkdir ~/artifacts/FCC/ |
108 | | - mv .pio/build/${{ matrix.target }} ~/artifacts/FCC/`echo ${{ matrix.target }} | sed s/_via.*//` |
| 109 | + PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_FCC_915" pio run -e ${{ matrix.target }} |
| 110 | + OUTDIR=~/artifacts/firmware/FCC/`echo ${{ matrix.target }} | sed s/_via.*//` |
| 111 | + mkdir -p $OUTDIR |
| 112 | + mv .pio/build/${{ matrix.target }}/firmware.{elrs,bin} $OUTDIR >& /dev/null || : |
109 | 113 | ;; |
110 | 114 | esac |
111 | | - if [[ ${{matrix.target}} == *ESP32* ]] ; then |
112 | | - cp ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin ~/artifacts/ |
113 | | - cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin ~/artifacts/ |
| 115 | + # copy the common ESP32 files |
| 116 | + if [[ ${{matrix.target}} == *ESP32* ]] ; then |
| 117 | + cp ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin ~/artifacts/firmware/ |
| 118 | + cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin ~/artifacts/firmware/ |
| 119 | + mv .pio/build/${{ matrix.target }}/partitions.bin ~/artifacts/firmware/ |
114 | 120 | fi |
115 | 121 |
|
116 | 122 | - name: Store Artifacts |
117 | 123 | uses: actions/upload-artifact@v2-preview |
118 | 124 | with: |
119 | | - name: ExpressLRS-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.run_number }} |
120 | | - path: | |
121 | | - ~/artifacts/**/*.bin |
122 | | - ~/artifacts/**/*.elrs |
| 125 | + name: firmware |
| 126 | + path: ~/artifacts/**/* |
123 | 127 | continue-on-error: true |
| 128 | + |
| 129 | + firmware: |
| 130 | + needs: build |
| 131 | + runs-on: ubuntu-latest |
| 132 | + steps: |
| 133 | + - name: Checkout code |
| 134 | + uses: actions/checkout@v2 |
| 135 | + |
| 136 | + - name: Get firmware artifacts |
| 137 | + uses: actions/download-artifact@v3 |
| 138 | + with: |
| 139 | + name: firmware |
| 140 | + path: dist |
| 141 | + |
| 142 | + - name: Copy hardware files to firmware folder |
| 143 | + run: cp -r src/hardware dist/firmware |
| 144 | + |
| 145 | + - name: Copy bootloader files to firmware folder |
| 146 | + run: cd src ; find bootloader -name \*.bin -o -name \*.frk | grep -v src/ | cpio -pdm ../dist/firmware |
| 147 | + |
| 148 | + - name: Update firmware artifact |
| 149 | + uses: actions/upload-artifact@v2 |
| 150 | + with: |
| 151 | + name: firmware |
| 152 | + path: dist/**/* |
| 153 | + |
| 154 | + installer: |
| 155 | + strategy: |
| 156 | + fail-fast: false |
| 157 | + matrix: |
| 158 | + os: [windows-latest, ubuntu-latest, macos-latest] |
| 159 | + runs-on: ${{ matrix.os }} |
| 160 | + steps: |
| 161 | + - uses: actions/checkout@v2 |
| 162 | + - uses: actions/setup-python@v2 |
| 163 | + with: |
| 164 | + python-version: 3.7 |
| 165 | + |
| 166 | + - run: pip install pyserial |
| 167 | + - run: pip install pyinstaller |
| 168 | + - run: pyinstaller -F src/python/binary_configurator.py -n installer-${{ matrix.os }} |
| 169 | + |
| 170 | + - uses: actions/upload-artifact@v2 |
| 171 | + with: |
| 172 | + name: installer |
| 173 | + path: dist/* |
0 commit comments