Skip to content

Commit c705bc0

Browse files
committed
fix
1 parent be685e8 commit c705bc0

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.github/workflows/cron_build.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ jobs:
5353
source ./tools/check-deploy-needed.sh
5454
targets_list=$(echo "${{ inputs.targets }}" | sed 's/ *, */,/g' | sed 's/^/["/' | sed 's/$/"]/' | sed 's/,/","/g')
5555
echo "Targets list: $targets_list"
56-
echo "deploy_needed=$DEPLOY_NEEDED" >> $GITHUB_OUTPUT
5756
echo "targets_list=$targets_list" >> $GITHUB_OUTPUT
5857
5958
build-libs:
6059
name: Build for ${{ matrix.target }} (${{ inputs.idf_branch }})
6160
runs-on: ubuntu-latest
62-
if: needs.check-if-needed.outputs.deploy_needed == '1'
61+
if: needs.check-if-needed.outputs.libs_has_asset == '0'
6362
needs: check-if-needed
6463
strategy:
6564
fail-fast: false
@@ -111,21 +110,25 @@ jobs:
111110
ref: ${{ inputs.lib_builder_branch }}
112111

113112
- name: Replace invalid characters in the artifact name
113+
if: needs.check-if-needed.outputs.libs_has_asset == '0'
114114
run: |
115115
branch=${{ inputs.idf_branch }}
116116
echo "libs_branch=${branch//\//_}" >> $GITHUB_ENV
117117
118118
- name: Download artifacts
119+
if: needs.check-if-needed.outputs.libs_has_asset == '0'
119120
uses: actions/download-artifact@v4
120121
with:
121122
path: dist
122123
pattern: libs-${{ env.libs_branch }}-*
123124
merge-multiple: true
124125

125126
- name: Combine artifacts
127+
if: needs.check-if-needed.outputs.libs_has_asset == '0'
126128
run: bash ./tools/combine-artifacts.sh
127129

128130
- name: Upload full esp32-arduino-libs archive
131+
if: needs.check-if-needed.outputs.libs_has_asset == '0'
129132
uses: actions/upload-artifact@v4
130133
with:
131134
name: esp32-arduino-libs-${{ env.libs_branch }}

tools/check-deploy-needed.sh

+14-12
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ echo "LIBS_HAS_RELEASE: $LIBS_HAS_RELEASE"
8484
echo "LIBS_ASSET_ID: $LIBS_ASSET_ID"
8585
echo "LIBS_HAS_ASSET: $LIBS_HAS_ASSET"
8686

87+
if [ "$LIBS_HAS_RELEASE" == "1" ]; then
88+
if [ "$LIBS_HAS_ASSET" == "0" ] || [ "$AR_HAS_COMMIT" == "0" ]; then
89+
echo "Deploy needed"
90+
export DEPLOY_NEEDED="1"
91+
else
92+
echo "Deploy not needed. Skipping..."
93+
export DEPLOY_NEEDED="0"
94+
fi
95+
else
96+
echo "Release for tag \"$LIBS_RELEASE_TAG\" not found. Please create the release first."
97+
exit 1
98+
fi
99+
87100
if [ ! -x $GITHUB_OUTPUT ]; then
88101
echo "idf_commit=$IDF_COMMIT" >> "$GITHUB_OUTPUT"
89102
echo "ar_branch=$AR_BRANCH" >> "$GITHUB_OUTPUT"
@@ -99,17 +112,6 @@ if [ ! -x $GITHUB_OUTPUT ]; then
99112
echo "libs_has_release=$LIBS_HAS_RELEASE" >> "$GITHUB_OUTPUT"
100113
echo "libs_asset_id=$LIBS_ASSET_ID" >> "$GITHUB_OUTPUT"
101114
echo "libs_has_asset=$LIBS_HAS_ASSET" >> "$GITHUB_OUTPUT"
115+
echo "deploy_needed=$DEPLOY_NEEDED" >> "$GITHUB_OUTPUT"
102116
fi
103117

104-
if [ "$LIBS_HAS_RELEASE" == "1" ]; then
105-
if [ "$LIBS_HAS_ASSET" == "0" ] || [ "$AR_HAS_COMMIT" == "0" ]; then
106-
echo "Deploy needed"
107-
export DEPLOY_NEEDED="1"
108-
else
109-
echo "Deploy not needed. Skipping..."
110-
export DEPLOY_NEEDED="0"
111-
fi
112-
else
113-
echo "Release for tag \"$LIBS_RELEASE_TAG\" not found. Please create the release first."
114-
exit 1
115-
fi

0 commit comments

Comments
 (0)