|
| 1 | +name: HyperSerialPico CI Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "**" # Runs on push to any branch |
| 7 | + |
| 8 | +jobs: |
| 9 | + ########################### |
| 10 | + #### HyperSerialPico ###### |
| 11 | + ########################### |
| 12 | + |
| 13 | + HyperSerialPico: |
| 14 | + runs-on: ubuntu-22.04 |
| 15 | + |
| 16 | + steps: |
| 17 | + |
| 18 | + with: |
| 19 | + submodules: recursive |
| 20 | + |
| 21 | + - name: Install GNU Arm Embedded Toolchain |
| 22 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 23 | + with: |
| 24 | + release: "12.2.Rel1" |
| 25 | + |
| 26 | + - name: Build packages |
| 27 | + shell: bash |
| 28 | + run: | |
| 29 | + mkdir build |
| 30 | + cd build |
| 31 | + cmake .. |
| 32 | + cmake --build . --config Release |
| 33 | +
|
| 34 | + |
| 35 | + name: Upload artifacts (commit) |
| 36 | + if: (startsWith(github.event.ref, 'refs/tags') != true) |
| 37 | + with: |
| 38 | + path: | |
| 39 | + firmware/*.uf2 |
| 40 | +
|
| 41 | + |
| 42 | + name: Upload artifacts (release) |
| 43 | + if: startsWith(github.ref, 'refs/tags/') |
| 44 | + with: |
| 45 | + name: firmware-release-generic |
| 46 | + path: | |
| 47 | + firmware/*.uf2 |
| 48 | +
|
| 49 | + - name: Build packages for Adafruit Feather RP2040 Scorpio (release-only) |
| 50 | + if: startsWith(github.ref, 'refs/tags/') |
| 51 | + shell: bash |
| 52 | + run: | |
| 53 | + cd build |
| 54 | + rm *.* |
| 55 | + rm ../firmware/* |
| 56 | + echo "Neopixel is using GPIO16(OUTPUT_DATA_PIN) on output 0." > ../firmware/Firmwares_for_Adafruit_Feather_RP2040_Scorpio.txt |
| 57 | + echo "SPI is using spi0 interface pins: GPIO19(OUTPUT_SPI_DATA_PIN) and GPIO18(OUTPUT_SPI_CLOCK_PIN) on output 3 and 2 respectively." >> ../firmware/Firmwares_for_Adafruit_Feather_RP2040_Scorpio.txt |
| 58 | + cmake -DOVERRIDE_BOOT_WORKAROUND=ON -DOVERRIDE_DATA_PIN=16 -DOVERRIDE_SPI_DATA_PIN=19 -DOVERRIDE_SPI_CLOCK_PIN=18 -DCMAKE_BUILD_TYPE=Release .. |
| 59 | + cmake --build . |
| 60 | + zip -j ../firmware/Adafruit_Feather_RP2040_Scorpio.zip ../firmware/* |
| 61 | +
|
| 62 | + |
| 63 | + name: Upload artifacts (release Adafruit_Feather) |
| 64 | + if: startsWith(github.ref, 'refs/tags/') |
| 65 | + with: |
| 66 | + name: firmware-release-adafruit-scorpio |
| 67 | + path: | |
| 68 | + firmware/*.zip |
| 69 | +
|
| 70 | + - name: Build packages for Adafruit ItsyBitsy RP2040 (release-only) |
| 71 | + if: startsWith(github.ref, 'refs/tags/') |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + cd build |
| 75 | + rm *.* |
| 76 | + rm ../firmware/* |
| 77 | + echo "Neopixel is using GPIO14(OUTPUT_DATA_PIN) on output 5." > ../firmware/Firmwares_for_Adafruit_ItsyBitsy_2040.txt |
| 78 | + cmake -DOVERRIDE_BOOT_WORKAROUND=ON -DOVERRIDE_DATA_PIN=14 -DCMAKE_BUILD_TYPE=Release .. |
| 79 | + cmake --build . |
| 80 | + rm ../firmware/*_Spi.uf2 |
| 81 | + zip -j ../firmware/Adafruit_ItsyBitsy_2040.zip ../firmware/* |
| 82 | +
|
| 83 | + |
| 84 | + name: Upload artifacts (release Adafruit_ItsyBitsy) |
| 85 | + if: startsWith(github.ref, 'refs/tags/') |
| 86 | + with: |
| 87 | + name: firmware-release-adafruit-itsybitsy |
| 88 | + path: | |
| 89 | + firmware/*.zip |
| 90 | +
|
| 91 | + - name: Build packages for Pimoroni Plasma Stick 2040 W (release-only) |
| 92 | + if: startsWith(github.ref, 'refs/tags/') |
| 93 | + shell: bash |
| 94 | + run: | |
| 95 | + cd build |
| 96 | + rm *.* |
| 97 | + rm ../firmware/* |
| 98 | + echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output PIXELS." > ../firmware/Firmwares_for_Pimoroni_Plasma_Stick_2040_W.txt |
| 99 | + cmake -DOVERRIDE_DATA_PIN=15 -DCMAKE_BUILD_TYPE=Release .. |
| 100 | + cmake --build . |
| 101 | + rm ../firmware/*_Spi.uf2 |
| 102 | + zip -j ../firmware/Pimoroni_Plasma_Stick_2040_W.zip ../firmware/* |
| 103 | +
|
| 104 | + |
| 105 | + name: Upload artifacts (release Pimoroni_Plasma_Stick_W) |
| 106 | + if: startsWith(github.ref, 'refs/tags/') |
| 107 | + with: |
| 108 | + name: firmware-release-pimoroni-plasma-stick |
| 109 | + path: | |
| 110 | + firmware/*.zip |
| 111 | +
|
| 112 | + - name: Build packages for Pimoroni Plasma 2040 (release-only) |
| 113 | + if: startsWith(github.ref, 'refs/tags/') |
| 114 | + shell: bash |
| 115 | + run: | |
| 116 | + cd build |
| 117 | + rm *.* |
| 118 | + rm ../firmware/* |
| 119 | + echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output DA." > ../firmware/Firmwares_for_Pimoroni_Plasma_2040.txt |
| 120 | + echo "SPI is using spi1 interface pins: GPIO15(OUTPUT_SPI_DATA_PIN) and GPIO14(OUTPUT_SPI_CLOCK_PIN) on output DA and CL respectively." >> ../firmware/Firmwares_for_Pimoroni_Plasma_2040.txt |
| 121 | + cmake -DOVERRIDE_DATA_PIN=15 -DOVERRIDE_SPI_INTERFACE=spi1 -DOVERRIDE_SPI_DATA_PIN=15 -DOVERRIDE_SPI_CLOCK_PIN=14 -DCMAKE_BUILD_TYPE=Release .. |
| 122 | + cmake --build . |
| 123 | + zip -j ../firmware/Pimoroni_Plasma_2040.zip ../firmware/* |
| 124 | +
|
| 125 | + |
| 126 | + name: Upload artifacts (release Pimoroni_Plasma) |
| 127 | + if: startsWith(github.ref, 'refs/tags/') |
| 128 | + with: |
| 129 | + name: firmware-release-pimoroni-plasma |
| 130 | + path: | |
| 131 | + firmware/*.zip |
| 132 | +
|
| 133 | + ################################ |
| 134 | + ###### Publish Releases ######## |
| 135 | + ################################ |
| 136 | + |
| 137 | + publish: |
| 138 | + name: Publish Releases |
| 139 | + if: startsWith(github.event.ref, 'refs/tags') |
| 140 | + needs: [HyperSerialPico] |
| 141 | + runs-on: ubuntu-22.04 |
| 142 | + permissions: |
| 143 | + contents: write |
| 144 | + steps: |
| 145 | + # generate environment variables |
| 146 | + - name: Generate environment variables from version and tag |
| 147 | + run: | |
| 148 | + echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV |
| 149 | + echo "preRelease=false" >> $GITHUB_ENV |
| 150 | +
|
| 151 | + # If version contains alpha or beta, mark draft release as pre-release |
| 152 | + - name: Mark release as pre-release |
| 153 | + if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') |
| 154 | + run: echo "preRelease=true" >> $GITHUB_ENV |
| 155 | + |
| 156 | + |
| 157 | + with: |
| 158 | + pattern: firmware-release-* |
| 159 | + merge-multiple: true |
| 160 | + |
| 161 | + # create draft release and upload artifacts |
| 162 | + - name: Create draft release |
| 163 | + |
| 164 | + with: |
| 165 | + name: HyperSerialPico ${{ env.VERSION }} |
| 166 | + tag_name: ${{ env.TAG }} |
| 167 | + files: | |
| 168 | + *.uf2 |
| 169 | + *.zip |
| 170 | + draft: true |
| 171 | + prerelease: ${{ env.preRelease }} |
| 172 | + env: |
| 173 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments