-
Notifications
You must be signed in to change notification settings - Fork 19
109 lines (106 loc) · 3.47 KB
/
master_cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Binary and DBC Generation
on:
push:
branches:
- master
jobs:
# ======= Build Binaries =======
build:
name: Build Firmware
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- board: quadruna_VC
bin_name: quadruna_VC_app_metadata.hex
build_dir: firmware/quadruna/VC
- board: quadruna_BMS
bin_name: quadruna_BMS_app_metadata.hex
build_dir: firmware/quadruna/BMS
- board: quadruna_FSM
bin_name: quadruna_FSM_app_metadata.hex
build_dir: firmware/quadruna/FSM
- board: quadruna_RSM
bin_name: quadruna_RSM_app_metadata.hex
build_dir: firmware/quadruna/RSM
- board: quadruna_CRIT
bin_name: quadruna_CRIT_app_metadata.hex
build_dir: firmware/quadruna/CRIT
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.docker_token }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/build_binary
with:
board: ${{ matrix.board }}
# Uploads .hex binary to Github Actions workflow
- name: Save built artifact
uses: actions/upload-artifact@v4
env:
BUILD_DIR: build_fw_deploy
with:
name: ${{ matrix.bin_name }}
path: "${{ env.BUILD_DIR }}/${{ matrix.build_dir }}/${{ matrix.bin_name }}"
# ======= Generate DBC =======
generate-dbc:
name: Generate CAN DBC file
runs-on: ubuntu-22.04
container:
image: ubcformulaelectric/environment:latest
credentials:
username: ubcformulaelectric
password: ${{ secrets.docker_token }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
scripts
can_bus
- name: Generate and Upload DBC
uses: ./.github/actions/build_dbc
- name: Upload DBC to Artifact
uses: actions/upload-artifact@v4
with:
name: quadruna.dbc
path: quadruna.dbc
# ======= MAKE THE RELEASE =======
make-release:
name: Add Binaries and DBC to Release Tab
runs-on: ubuntu-22.04
needs: [ build, generate-dbc ]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
sparse-checkout: .github
- name: Download Binaries and DBC from Artifacts
uses: actions/download-artifact@v4
with:
path: ./
- name: Debug Environment
run: ls -l -a
- name: Create Release
uses: ./.github/actions/push_release
with:
# https://github.com/actions/download-artifact#download-all-artifacts
files: |
quadruna_VC_app_metadata.hex/quadruna_VC_app_metadata.hex
quadruna_BMS_app_metadata.hex/quadruna_BMS_app_metadata.hex
quadruna_FSM_app_metadata.hex/quadruna_FSM_app_metadata.hex
quadruna_RSM_app_metadata.hex/quadruna_RSM_app_metadata.hex
quadruna_CRIT_app_metadata.hex/quadruna_CRIT_app_metadata.hex
quadruna.dbc/quadruna.dbc
latest: true
title: "Stable Binaries and DBCs"
body: "This release contains the latest stable binaries and DBCs."
tag_name: "latest"