|
| 1 | +#name: Build |
| 2 | +# |
| 3 | +#on: |
| 4 | +# pull_request: |
| 5 | +# push: |
| 6 | +# repository_dispatch: |
| 7 | +# release: |
| 8 | +# types: |
| 9 | +# - created |
| 10 | +# |
| 11 | +#jobs: |
| 12 | +# build: |
| 13 | +# runs-on: ubuntu-latest |
| 14 | +# strategy: |
| 15 | +# fail-fast: false |
| 16 | +# matrix: |
| 17 | +# board: |
| 18 | +# # Adafruit Boards |
| 19 | +# - 'circuitplayground_nrf52840' |
| 20 | +# - 'clue_nrf52840' |
| 21 | +# - 'feather_nrf52832' |
| 22 | +# - 'feather_nrf52840_express' |
| 23 | +# - 'feather_nrf52840_sense' |
| 24 | +# - 'itsybitsy_nrf52840_express' |
| 25 | +# - 'metro_nrf52840_express' |
| 26 | +# # Alphabetical order |
| 27 | +# - 'adm_b_nrf52840_1' |
| 28 | +# - 'ae_bl652_bo' |
| 29 | +# - 'aramcon_badge_2019' |
| 30 | +# - 'aramcon2_badge' |
| 31 | +# - 'arcade_feather_nrf52840_express' |
| 32 | +# - 'arduino_nano_33_ble' |
| 33 | +# - 'bast_ble' |
| 34 | +# - 'bluemicro_nrf52840' |
| 35 | +# - 'ebyte_e104_bt5032a' |
| 36 | +# - 'ebyte_e73_tbb' |
| 37 | +# - 'electronut_labs_papyr' |
| 38 | +# - 'ikigaisense_vita' |
| 39 | +# - 'm60_keyboard' |
| 40 | +# - 'mdk_nrf52840_dongle' |
| 41 | +# - 'nice_nano' |
| 42 | +# - 'nrf52840_m2' |
| 43 | +# - 'ohs2020_badge' |
| 44 | +# - 'particle_argon' |
| 45 | +# - 'particle_boron' |
| 46 | +# - 'particle_xenon' |
| 47 | +# - 'pca10056' |
| 48 | +# - 'pca10059' |
| 49 | +# - 'pca10100' |
| 50 | +# - 'pitaya_go' |
| 51 | +# - 'raytac_mdbt50q_rx' |
| 52 | +# - 'sparkfun_nrf52840_micromod' |
| 53 | +# - 'waveshare_nrf52840_eval' |
| 54 | +# |
| 55 | +# steps: |
| 56 | +# - name: Setup Python |
| 57 | +# uses: actions/setup-python@v2 |
| 58 | +# |
| 59 | +# - name: Setup Node.js |
| 60 | +# uses: actions/setup-node@v4 |
| 61 | +# |
| 62 | +# - name: Checkout Code |
| 63 | +# uses: actions/checkout@v4 |
| 64 | +# with: |
| 65 | +# submodules: true |
| 66 | +# |
| 67 | +# - name: Install Toolchains |
| 68 | +# run: | |
| 69 | +# pip3 install adafruit-nrfutil uritemplate requests intelhex |
| 70 | +# npm install --global xpm |
| 71 | +# # 9.3.1-1.2.1 is xpack modified version which significantly increased compiled size to 6-7KB and cause flash overflow. |
| 72 | +# # Skip this version for now, we will try again with next official release from ARM |
| 73 | +# xpm install --global @xpack-dev-tools/[email protected] |
| 74 | +# echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH |
| 75 | +# |
| 76 | +# - name: Build |
| 77 | +# run: | |
| 78 | +# make BOARD=${{ matrix.board }} all |
| 79 | +# make BOARD=${{ matrix.board }} copy-artifact |
| 80 | +# |
| 81 | +# - uses: actions/upload-artifact@v4 |
| 82 | +# with: |
| 83 | +# name: ${{ matrix.board }} |
| 84 | +# path: _bin/${{ matrix.board }} |
| 85 | +# |
| 86 | +# - name: Create Release Asset |
| 87 | +# if: ${{ github.event_name == 'release' }} |
| 88 | +# run: zip -jr ${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}.zip _bin/${{ matrix.board }} |
| 89 | +# |
| 90 | +# - name: Upload Release Asset |
| 91 | +# uses: actions/upload-release-asset@v1 |
| 92 | +# env: |
| 93 | +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 94 | +# if: ${{ github.event_name == 'release' }} |
| 95 | +# with: |
| 96 | +# upload_url: ${{ github.event.release.upload_url }} |
| 97 | +# asset_path: ${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}.zip |
| 98 | +# asset_name: ${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}.zip |
| 99 | +# asset_content_type: application/zip |
| 100 | +# |
| 101 | +# - name: Upload Release Asset for Self-Update |
| 102 | +# uses: actions/upload-release-asset@v1 |
| 103 | +# env: |
| 104 | +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 105 | +# if: ${{ github.event_name == 'release' }} |
| 106 | +# with: |
| 107 | +# upload_url: ${{ github.event.release.upload_url }} |
| 108 | +# asset_path: _bin/${{ matrix.board }}/update-${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}_nosd.uf2 |
| 109 | +# asset_name: update-${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}_nosd.uf2 |
| 110 | +# asset_content_type: application/x-binary |
| 111 | + |
1 | 112 | name: Build |
2 | 113 |
|
3 | 114 | on: |
|
9 | 120 | - created |
10 | 121 |
|
11 | 122 | jobs: |
| 123 | + set-matrix: |
| 124 | + runs-on: ubuntu-latest |
| 125 | + outputs: |
| 126 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 127 | + steps: |
| 128 | + - name: Checkout Code |
| 129 | + uses: actions/checkout@v4 |
| 130 | + |
| 131 | + - name: Set matrix |
| 132 | + id: set-matrix |
| 133 | + working-directory: src/boards |
| 134 | + run: | |
| 135 | + MATRIX_JSON=$(ls -d */ | sed 's/\/$//' | jq -R -s -c 'split("\n")[:-1]') |
| 136 | + echo "matrix=$MATRIX_JSON" |
| 137 | + echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT |
| 138 | +
|
12 | 139 | build: |
| 140 | + needs: set-matrix |
13 | 141 | runs-on: ubuntu-latest |
14 | 142 | strategy: |
15 | 143 | fail-fast: false |
16 | 144 | matrix: |
17 | | - board: |
18 | | - # Adafruit Boards |
19 | | - - 'circuitplayground_nrf52840' |
20 | | - - 'clue_nrf52840' |
21 | | - - 'feather_nrf52832' |
22 | | - - 'feather_nrf52840_express' |
23 | | - - 'feather_nrf52840_sense' |
24 | | - - 'itsybitsy_nrf52840_express' |
25 | | - - 'metro_nrf52840_express' |
26 | | - # Alphabetical order |
27 | | - - 'adm_b_nrf52840_1' |
28 | | - - 'ae_bl652_bo' |
29 | | - - 'aramcon_badge_2019' |
30 | | - - 'aramcon2_badge' |
31 | | - - 'arcade_feather_nrf52840_express' |
32 | | - - 'arduino_nano_33_ble' |
33 | | - - 'bast_ble' |
34 | | - - 'bluemicro_nrf52840' |
35 | | - - 'ebyte_e104_bt5032a' |
36 | | - - 'ebyte_e73_tbb' |
37 | | - - 'electronut_labs_papyr' |
38 | | - - 'ikigaisense_vita' |
39 | | - - 'm60_keyboard' |
40 | | - - 'mdk_nrf52840_dongle' |
41 | | - - 'nice_nano' |
42 | | - - 'nrf52840_m2' |
43 | | - - 'ohs2020_badge' |
44 | | - - 'particle_argon' |
45 | | - - 'particle_boron' |
46 | | - - 'particle_xenon' |
47 | | - - 'pca10056' |
48 | | - - 'pca10059' |
49 | | - - 'pca10100' |
50 | | - - 'pitaya_go' |
51 | | - - 'raytac_mdbt50q_rx' |
52 | | - - 'sparkfun_nrf52840_micromod' |
53 | | - - 'waveshare_nrf52840_eval' |
54 | | - |
| 145 | + board: ${{ fromJSON(needs.set-matrix.outputs.matrix) }} |
55 | 146 | steps: |
56 | | - - name: Setup Python |
57 | | - uses: actions/setup-python@v2 |
58 | | - |
59 | | - - name: Setup Node.js |
60 | | - uses: actions/setup-node@v4 |
61 | | - |
62 | 147 | - name: Checkout Code |
63 | 148 | uses: actions/checkout@v4 |
64 | 149 | with: |
65 | | - submodules: true |
66 | | - |
67 | | - - name: Install Toolchains |
| 150 | + fetch-depth: 0 |
| 151 | + submodules: true |
| 152 | + |
| 153 | + - name: Install ARM GCC |
| 154 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 155 | + with: |
| 156 | + release: '12.3.Rel1' |
| 157 | + |
| 158 | + - name: Install Tools |
68 | 159 | run: | |
69 | | - pip3 install adafruit-nrfutil uritemplate requests intelhex |
70 | | - npm install --global xpm |
71 | | - # 9.3.1-1.2.1 is xpack modified version which significantly increased compiled size to 6-7KB and cause flash overflow. |
72 | | - # Skip this version for now, we will try again with next official release from ARM |
73 | | - xpm install --global @xpack-dev-tools/[email protected] |
74 | | - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH |
75 | | - |
| 160 | + pip3 install adafruit-nrfutil uritemplate requests intelhex setuptools |
| 161 | +
|
76 | 162 | - name: Build |
77 | 163 | run: | |
78 | 164 | make BOARD=${{ matrix.board }} all |
79 | 165 | make BOARD=${{ matrix.board }} copy-artifact |
80 | | - |
| 166 | +
|
81 | 167 | - uses: actions/upload-artifact@v4 |
82 | 168 | with: |
83 | 169 | name: ${{ matrix.board }} |
84 | 170 | path: _bin/${{ matrix.board }} |
85 | 171 |
|
86 | | - - name: Create Release Asset |
87 | | - if: ${{ github.event_name == 'release' }} |
88 | | - run: zip -jr ${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}.zip _bin/${{ matrix.board }} |
89 | | - |
90 | 172 | - name: Upload Release Asset |
91 | | - uses: actions/upload-release-asset@v1 |
92 | | - env: |
93 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
94 | | - if: ${{ github.event_name == 'release' }} |
95 | | - with: |
96 | | - upload_url: ${{ github.event.release.upload_url }} |
97 | | - asset_path: ${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}.zip |
98 | | - asset_name: ${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}.zip |
99 | | - asset_content_type: application/zip |
100 | | - |
101 | | - - name: Upload Release Asset for Self-Update |
102 | | - uses: actions/upload-release-asset@v1 |
103 | | - env: |
104 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 173 | + uses: softprops/action-gh-release@v1 |
105 | 174 | if: ${{ github.event_name == 'release' }} |
106 | 175 | with: |
107 | | - upload_url: ${{ github.event.release.upload_url }} |
108 | | - asset_path: _bin/${{ matrix.board }}/update-${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}_nosd.uf2 |
109 | | - asset_name: update-${{ matrix.board }}_bootloader-${{ github.event.release.tag_name }}_nosd.uf2 |
110 | | - asset_content_type: application/x-binary |
| 176 | + files: | |
| 177 | + _bin/${{ matrix.board }}/${{ matrix.board }}_bootloader-*.zip |
| 178 | + _bin/${{ matrix.board }}/${{ matrix.board }}_bootloader-*.hex |
| 179 | + _bin/${{ matrix.board }}/update-${{ matrix.board }}_bootloader-*.uf2 |
0 commit comments