tooling: Enable ruff S110 to detect try-except-pass. (#383) #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| name: Semantic Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| outputs: | |
| new-release-published: ${{ steps.semantic.outputs.new-release-published }} | |
| new-release-version: ${{ steps.semantic.outputs.new-release-version }} | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.RELEASE_APP_ID }} | |
| private_key: ${{ secrets.RELEASE_APP_SECRET }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.generate_token.outputs.token }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Run semantic-release | |
| id: semantic | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| HUSKY: "0" | |
| run: npx semantic-release | |
| firmware: | |
| name: Build and attach firmware | |
| needs: release | |
| if: needs.release.outputs.new-release-published == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.RELEASE_APP_ID }} | |
| private_key: ${{ secrets.RELEASE_APP_SECRET }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: v${{ needs.release.outputs.new-release-version }} | |
| - name: Install ARM toolchain | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi | |
| - name: Build firmware | |
| run: make firmware | |
| - name: Attach firmware to release | |
| env: | |
| GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| run: | | |
| VERSION="v${{ needs.release.outputs.new-release-version }}" | |
| BUILD_DIR=".build/micropython-steami/ports/stm32/build-STEAM32_WB55RG" | |
| cp "${BUILD_DIR}/firmware.hex" "steami-micropython-firmware-${VERSION}.hex" | |
| cp "${BUILD_DIR}/firmware.bin" "steami-micropython-firmware-${VERSION}.bin" | |
| gh release upload "$VERSION" \ | |
| "steami-micropython-firmware-${VERSION}.hex" \ | |
| "steami-micropython-firmware-${VERSION}.bin" \ | |
| --clobber |