-
Notifications
You must be signed in to change notification settings - Fork 33
122 lines (118 loc) · 4.21 KB
/
build_release_bins.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
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build and Release the OpenIris bin files
on:
workflow_dispatch:
push:
tags:
- "v*"
branches:
- "master"
- "main"
- "beta"
- "feature/improv"
pull_request:
branches:
- "master"
- "main"
- "beta"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: echo "matrix={\"target_name\":[\"esp32AIThinker\",\"esp32M5Stack\",\"esp32Cam\",\"esp_eye\",\"wrover\",\"wrooms3QIO\",\"wrooms3QIOUSB\",\"wrooms3\",\"wrooms3USB\",\"xiaosenses3\",\"xiaosenses3_USB\"],\"target_build_type\":[\"\", \"_release\"]}" >> $GITHUB_OUTPUT
build:
needs: setup
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup.outputs.matrix)}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build OpenIris Firmware
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/zanzythebar/piodocker:latest
options: -v ${{ github.workspace }}:/workspace
run: |
cd ESP
export OPENIRIS_CI_BUILD=1
mkdir build
mkdir build/${{ matrix.target_name }}${{ matrix.target_build_type }}
echo "::endgroup::"
echo "::group::pio run"
pio run --environment ${{ matrix.target_name }}${{ matrix.target_build_type }}
echo "::endgroup::"
echo "::group::create zip"
unzip -l 'build/${{ matrix.target_name }}${{ matrix.target_build_type }}/*.zip'
echo "::endgroup::"
echo "::group::copy firmware name file"
cp tools/firmware_name.txt build/${{ matrix.target_name }}${{ matrix.target_build_type }}/firmware_name.txt
echo "::endgroup::"
- name: Archive Firmware name File
# create an environment variable with the name of the firmware file by catting the firmware_name.txt file
run: |
echo "FIRMWARE_NAME=$(cat ESP/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/firmware_name.txt)" >> $GITHUB_ENV
- name: Archive Firmware Binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware
#path: "./ESP/.pio/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.bin"
path: "ESP/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.zip"
retention-days: 5
if-no-files-found: error
release-openiris:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Directory
run: mkdir -p build
- name: Download Firmware Files
uses: actions/download-artifact@v2
with:
path: build/
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g conventional-changelog-conventionalcommits@6
- run: npm install -g [email protected]
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
- run: npm install -g @semantic-release/changelog
- run: npm install -g @semantic-release/github
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo apt-get install -y jq
chmod +x ./repo-tools/scripts/prepareCMD.sh
semantic-release
cleanup:
needs: [setup, release-openiris]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup.outputs.matrix)}}
name: Cleanup actions
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware