forked from rusefi/fw-custom-example
-
Notifications
You must be signed in to change notification settings - Fork 3
118 lines (102 loc) · 3.69 KB
/
Copy pathnightly-release.yaml
File metadata and controls
118 lines (102 loc) · 3.69 KB
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
110
111
112
113
114
115
116
117
118
name: Nightly Release
on:
schedule:
- cron: '0 2 * * *' # 2 AM UTC daily
workflow_dispatch:
inputs:
tag:
description: 'Release tag (default: today YYYY-MM-DD)'
required: false
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
tag: ${{ steps.set-tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set matrix
id: set-matrix
run: |
export EVENT_NAME="${{ github.event_name }}"
export RUN_ATTEMPT="${{ github.run_attempt }}"
export COMMIT_MESSAGE=""
echo "matrix=$(bash ext/rusefi/firmware/bin/generate_matrix.sh boards)" >> $GITHUB_OUTPUT
- name: Set release tag
id: set-tag
run: |
if [ -n "${{ github.event.inputs.tag }}" ]; then
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
fi
build:
needs: generate-matrix
runs-on: ubuntu-latest
if: ${{ ! contains(needs.generate-matrix.outputs.matrix, '[]') }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./ext/rusefi/.github/workflows/custom-board-build
with:
meta_info: ${{ matrix.meta-info }}
push: 'false'
run_simulator: 'false'
artifacts: bin srec hex
uploads: ''
MY_REPO_PAT: ${{ secrets.MY_REPO_PAT }}
ADDITIONAL_ENV: ${{ secrets.ADDITIONAL_ENV }}
release:
needs: [generate-matrix, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all firmware artifacts
uses: actions/download-artifact@v4
with:
path: release-assets/
merge-multiple: true
- name: List release assets
run: find release-assets/ -type f | sort
- name: Read changelog
id: changelog
run: |
if [ -f CHANGELOG.md ]; then
# Extract the latest release section
BODY=$(awk '/^## \[/{p++} p==1{print} p==2{exit}' CHANGELOG.md | tail -n +2)
echo "body<<CHANGELOG_EOF" >> $GITHUB_OUTPUT
echo "$BODY" >> $GITHUB_OUTPUT
echo "CHANGELOG_EOF" >> $GITHUB_OUTPUT
else
echo "body=Automated nightly firmware build." >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.generate-matrix.outputs.tag }}
name: Nightly ${{ needs.generate-matrix.outputs.tag }}
prerelease: true
body: |
Automated nightly firmware build for Mazduino boards.
${{ steps.changelog.outputs.body }}
## Boards included
- mazduino-compact (STM32F407VGT6, knock enabled)
- mazduino-lite (STM32F407VGT6, no knock)
- mazduino-mini6ch (STM32F427VGT6, ETB + traction control)
- mazduino-mega100 (STM32F407VGT6, 1MB, full features, USB + CAN)
- mazduino-mega100-512 (STM32F407VET6, 512KB, reduced feature set)
## Files
- `.bin` - raw firmware binary (flash via ST-Link or DFU)
- `.srec` - firmware with CRC checksum (flash via OpenBLT bootloader)
- `.hex` - Intel HEX format
## TunerStudio Connection
Connect via USB virtual COM port (all boards except mega100 variants which use CAN bus).
files: release-assets/*