|
16 | 16 | issues: write |
17 | 17 | pull-requests: write |
18 | 18 | id-token: write |
| 19 | + outputs: |
| 20 | + new-release-published: ${{ steps.semantic.outputs.new-release-published }} |
| 21 | + new-release-version: ${{ steps.semantic.outputs.new-release-version }} |
19 | 22 | steps: |
20 | 23 | - name: Generate token |
21 | 24 | id: generate_token |
|
37 | 40 | - run: npm ci |
38 | 41 |
|
39 | 42 | - name: Run semantic-release |
| 43 | + id: semantic |
40 | 44 | env: |
41 | 45 | GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |
42 | 46 | HUSKY: "0" |
43 | 47 | run: npx semantic-release |
| 48 | + |
| 49 | + firmware: |
| 50 | + name: Build and attach firmware |
| 51 | + needs: release |
| 52 | + if: needs.release.outputs.new-release-published == 'true' |
| 53 | + runs-on: ubuntu-latest |
| 54 | + permissions: |
| 55 | + contents: write |
| 56 | + env: |
| 57 | + BOARD: STEAM32_WB55RG |
| 58 | + MICROPYTHON_REPO: https://github.com/steamicc/micropython-steami.git |
| 59 | + MICROPYTHON_BRANCH: stm32-steami-rev1d-final |
| 60 | + steps: |
| 61 | + - name: Generate token |
| 62 | + id: generate_token |
| 63 | + uses: tibdex/github-app-token@v2 |
| 64 | + with: |
| 65 | + app_id: ${{ secrets.RELEASE_APP_ID }} |
| 66 | + private_key: ${{ secrets.RELEASE_APP_SECRET }} |
| 67 | + |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + with: |
| 70 | + ref: v${{ needs.release.outputs.new-release-version }} |
| 71 | + |
| 72 | + - name: Install ARM toolchain |
| 73 | + run: | |
| 74 | + sudo apt-get update |
| 75 | + sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi |
| 76 | +
|
| 77 | + - name: Clone MicroPython |
| 78 | + run: | |
| 79 | + git clone --branch $MICROPYTHON_BRANCH $MICROPYTHON_REPO .build/micropython-steami |
| 80 | + cd .build/micropython-steami/ports/stm32 && make BOARD=$BOARD submodules |
| 81 | +
|
| 82 | + - name: Build firmware |
| 83 | + run: | |
| 84 | + rm -rf .build/micropython-steami/lib/micropython-steami-lib |
| 85 | + ln -s $GITHUB_WORKSPACE .build/micropython-steami/lib/micropython-steami-lib |
| 86 | + cd .build/micropython-steami/ports/stm32 && make BOARD=$BOARD |
| 87 | +
|
| 88 | + - name: Attach firmware to release |
| 89 | + env: |
| 90 | + GH_TOKEN: ${{ steps.generate_token.outputs.token }} |
| 91 | + run: | |
| 92 | + VERSION="v${{ needs.release.outputs.new-release-version }}" |
| 93 | + BUILD_DIR=".build/micropython-steami/ports/stm32/build-${BOARD}" |
| 94 | + cp "${BUILD_DIR}/firmware.hex" "steami-firmware-${VERSION}.hex" |
| 95 | + cp "${BUILD_DIR}/firmware.bin" "steami-firmware-${VERSION}.bin" |
| 96 | + gh release upload "$VERSION" \ |
| 97 | + "steami-firmware-${VERSION}.hex" \ |
| 98 | + "steami-firmware-${VERSION}.bin" \ |
| 99 | + --clobber |
0 commit comments