24
24
name : Check if deploy is needed for ${{ inputs.idf_branch }}
25
25
runs-on : ubuntu-latest
26
26
outputs :
27
+ idf_commit : ${{ steps.check.outputs.idf_commit }}
28
+ ar_branch : ${{ steps.check.outputs.ar_branch }}
29
+ ar_new_commit_message : ${{ steps.check.outputs.ar_new_commit_message }}
30
+ ar_new_branch_name : ${{ steps.check.outputs.ar_new_branch_name }}
31
+ ar_new_pr_title : ${{ steps.check.outputs.ar_new_pr_title }}
32
+ ar_has_commit : ${{ steps.check.outputs.ar_has_commit }}
33
+ ar_has_branch : ${{ steps.check.outputs.ar_has_branch }}
34
+ ar_has_pr : ${{ steps.check.outputs.ar_has_pr }}
35
+ libs_release_tag : ${{ steps.check.outputs.libs_release_tag }}
36
+ libs_version : ${{ steps.check.outputs.libs_version }}
37
+ libs_release_id : ${{ steps.check.outputs.libs_release_id }}
38
+ libs_has_release : ${{ steps.check.outputs.libs_has_release }}
39
+ libs_asset_id : ${{ steps.check.outputs.libs_asset_id }}
40
+ libs_has_asset : ${{ steps.check.outputs.libs_has_asset }}
27
41
deploy_needed : ${{ steps.check.outputs.deploy_needed }}
28
42
targets_list : ${{ steps.check.outputs.targets_list }}
29
43
steps :
@@ -39,13 +53,12 @@ jobs:
39
53
source ./tools/check-deploy-needed.sh
40
54
targets_list=$(echo "${{ inputs.targets }}" | sed 's/ *, */,/g' | sed 's/^/["/' | sed 's/$/"]/' | sed 's/,/","/g')
41
55
echo "Targets list: $targets_list"
42
- echo "deploy_needed=$DEPLOY_NEEDED" >> $GITHUB_OUTPUT
43
56
echo "targets_list=$targets_list" >> $GITHUB_OUTPUT
44
57
45
58
build-libs :
46
59
name : Build for ${{ matrix.target }} (${{ inputs.idf_branch }})
47
60
runs-on : ubuntu-latest
48
- if : needs.check-if-needed.outputs.deploy_needed == '1 '
61
+ if : needs.check-if-needed.outputs.libs_has_asset == '0 '
49
62
needs : check-if-needed
50
63
strategy :
51
64
fail-fast : false
@@ -87,47 +100,69 @@ jobs:
87
100
path : dist
88
101
89
102
combine-artifacts :
90
- name : Combine artifacts for IDF ${{ inputs.idf_branch }}
103
+ name : Combine artifacts and push changes for IDF ${{ inputs.idf_branch }}
91
104
runs-on : ubuntu-latest
92
105
needs : [check-if-needed, build-libs]
93
- if : needs.check-if-needed.outputs.deploy_needed == '1'
106
+ if : |
107
+ always() &&
108
+ needs.check-if-needed.result == 'success' &&
109
+ needs.check-if-needed.outputs.deploy_needed == '1'
94
110
steps :
95
111
- uses : actions/checkout@v4
96
112
with :
97
113
ref : ${{ inputs.lib_builder_branch }}
98
114
99
115
- name : Replace invalid characters in the artifact name
116
+ if : needs.check-if-needed.outputs.libs_has_asset == '0'
100
117
run : |
101
118
branch=${{ inputs.idf_branch }}
102
119
echo "libs_branch=${branch//\//_}" >> $GITHUB_ENV
103
120
104
121
- name : Download artifacts
122
+ if : needs.check-if-needed.outputs.libs_has_asset == '0'
105
123
uses : actions/download-artifact@v4
106
124
with :
107
125
path : dist
108
126
pattern : libs-${{ env.libs_branch }}-*
109
127
merge-multiple : true
110
128
111
129
- name : Combine artifacts
130
+ if : needs.check-if-needed.outputs.libs_has_asset == '0'
112
131
run : bash ./tools/combine-artifacts.sh
113
132
114
133
- name : Upload full esp32-arduino-libs archive
134
+ if : needs.check-if-needed.outputs.libs_has_asset == '0'
115
135
uses : actions/upload-artifact@v4
116
136
with :
117
137
name : esp32-arduino-libs-${{ env.libs_branch }}
118
- path : dist/esp32-arduino-libs.tar.gz
119
-
120
- - name : Upload package_esp32_index.template.json
121
- uses : actions/upload-artifact@v4
122
- with :
123
- name : package-esp32-index-json-${{ env.libs_branch }}
124
- path : dist/package_esp32_index.template.json
138
+ path : dist/esp32-arduino-libs.zip
139
+ compression-level : 0
125
140
126
141
- name : Push changes
127
142
if : github.repository == 'espressif/esp32-arduino-lib-builder'
128
143
env :
129
144
GITHUB_TOKEN : ${{ secrets.PUSH_TOKEN }}
130
145
GIT_AUTHOR_EMAIL : ${{ secrets.PUSH_EMAIL }}
131
146
GIT_COMMITTER_EMAIL : ${{ secrets.PUSH_EMAIL }}
147
+ IDF_COMMIT : ${{ needs.check-if-needed.outputs.idf_commit }}
148
+ AR_BRANCH : ${{ needs.check-if-needed.outputs.ar_branch }}
149
+ AR_NEW_COMMIT_MESSAGE : ${{ needs.check-if-needed.outputs.ar_new_commit_message }}
150
+ AR_NEW_BRANCH_NAME : ${{ needs.check-if-needed.outputs.ar_new_branch_name }}
151
+ AR_NEW_PR_TITLE : ${{ needs.check-if-needed.outputs.ar_new_pr_title }}
152
+ AR_HAS_COMMIT : ${{ needs.check-if-needed.outputs.ar_has_commit }}
153
+ AR_HAS_BRANCH : ${{ needs.check-if-needed.outputs.ar_has_branch }}
154
+ AR_HAS_PR : ${{ needs.check-if-needed.outputs.ar_has_pr }}
155
+ LIBS_RELEASE_TAG : ${{ needs.check-if-needed.outputs.libs_release_tag }}
156
+ LIBS_VERSION : ${{ needs.check-if-needed.outputs.libs_version }}
157
+ LIBS_RELEASE_ID : ${{ needs.check-if-needed.outputs.libs_release_id }}
158
+ LIBS_HAS_RELEASE : ${{ needs.check-if-needed.outputs.libs_has_release }}
159
+ LIBS_ASSET_ID : ${{ needs.check-if-needed.outputs.libs_asset_id }}
160
+ LIBS_HAS_ASSET : ${{ needs.check-if-needed.outputs.libs_has_asset }}
132
161
run : |
133
162
bash ./tools/push-to-arduino.sh
163
+
164
+ - name : Upload package_esp32_index.template.json
165
+ uses : actions/upload-artifact@v4
166
+ with :
167
+ name : package-esp32-index-json-${{ env.libs_branch }}
168
+ path : out/package_esp32_index.template.json
0 commit comments