fsm bootloader integration #7482
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: DBC Release | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| types: | |
| - labeled | |
| - unlabeled | |
| - synchronize | |
| jobs: | |
| determine-should-run: | |
| name: Check for want-DBC label | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| should_run: ${{ steps.should_run.outputs.should_run }} | |
| steps: | |
| - name: Determine Should Run | |
| id: should_run | |
| run: | | |
| echo "${{ toJSON(github.event.pull_request.labels.*.name) }}" | |
| echo "should_run=${{ contains(github.event.pull_request.labels.*.name, 'want_DBC') }}" >> $GITHUB_OUTPUT | |
| upload-dbc: | |
| name: Generate and Upload DBC to Artifact | |
| needs: [ determine-should-run ] | |
| if: needs.determine-should-run.outputs.should_run == 'true' | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: ubcformulaelectric/environment:arm_14 | |
| credentials: | |
| username: ubcformulaelectric | |
| password: ${{ secrets.docker_token }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| sparse-checkout: | | |
| .github | |
| scripts | |
| can_bus | |
| - name: Make Directory Safe | |
| run: git config --global --add safe.directory $(realpath .) | |
| - name: Generate DBC | |
| uses: ./.github/actions/build_dbc | |
| - name: Upload Quintuna DBC to Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: quintuna.dbc | |
| path: quintuna.dbc | |
| release-dbc: | |
| name: Create Release for DBC | |
| runs-on: ubuntu-latest | |
| needs: [ upload-dbc ] | |
| steps: | |
| # ========= DOWNLOAD FILES ========= | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| sparse-checkout: .github | |
| - name: Download Quintuna DBC from Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: quintuna.dbc | |
| - name: Log Files in Current Directory | |
| run: ls -l -a | |
| # ========= MAKE THE RELEASE ========= | |
| - name: Create Release for DBC | |
| uses: ./.github/actions/push_release | |
| with: | |
| files: | | |
| quintuna.dbc | |
| title: "DBC for ${{ github.head_ref }}" | |
| body: "DBC for ${{ github.head_ref }} generated by UBC Formula Electric Continuous Integration." | |
| tag_name: "${{ github.head_ref }}_tag" | |
| latest: false | |
| remove-dbc-and-release: | |
| name: Remove DBC and Release | |
| if: needs.determine-should-run.outputs.should_run == 'false' | |
| runs-on: ubuntu-latest | |
| needs: | |
| - determine-should-run | |
| steps: | |
| - name: Delete Release | |
| uses: dev-drprasad/delete-tag-and-release@v1.0 | |
| with: | |
| tag_name: "${{github.head_ref}}_tag" | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| delete_release: true |