Skip to content

Commit b33e29c

Browse files
fix: sign only idf repo plugins and simplifying the P2 metadata (#1368)
1 parent 63c3340 commit b33e29c

1 file changed

Lines changed: 34 additions & 25 deletions

File tree

.github/workflows/ci_release.yml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,41 @@ jobs:
7272
echo "Using certificate chain file"
7373
fi
7474
75-
# Find and sign JAR files using jarsigner with Jsign's JCA provider
76-
find releng/com.espressif.idf.update/target/repository -type f -name "*.jar" | while read -r file; do
77-
echo "Signing JAR: $file"
78-
79-
jarsigner \
80-
-J-cp -Jjsign-7.4.jar \
81-
-J--add-modules -Jjava.sql \
82-
-providerClass net.jsign.jca.JsignJcaProvider \
83-
-providerArg "${{ secrets.AZURE_KEYVAULT_URI }}" \
84-
-keystore NONE \
85-
-storetype AZUREKEYVAULT \
86-
-storepass "$AZURE_TOKEN" \
87-
-tsa http://timestamp.digicert.com \
88-
$CERTCHAIN_ARG \
89-
"$file" \
90-
"${{ secrets.AZURE_KEYVAULT_CERT_NAME }}"
91-
92-
if [ $? -eq 0 ]; then
93-
echo "Successfully signed: $file"
75+
REPO_DIR="releng/com.espressif.idf.update/target/repository"
76+
SIGFILE="ECLIPSE"
77+
78+
echo "Signing IDF plugin JARs in $REPO_DIR..."
79+
echo "Only signing JARs matching com.espressif.* pattern..."
80+
81+
find "$REPO_DIR" -type f -name "*.jar" | while read -r file; do
82+
if [[ "$file" =~ (plugins|features)/com\.espressif\. ]]; then
83+
echo "Signing IDF plugin/feature JAR: $file"
84+
85+
jarsigner \
86+
-J-cp -Jjsign-7.4.jar \
87+
-J--add-modules -Jjava.sql \
88+
-providerClass net.jsign.jca.JsignJcaProvider \
89+
-providerArg "${{ secrets.AZURE_KEYVAULT_URI }}" \
90+
-keystore NONE \
91+
-storetype AZUREKEYVAULT \
92+
-storepass "$AZURE_TOKEN" \
93+
-sigfile "$SIGFILE" \
94+
-digestalg SHA-256 \
95+
-tsa http://timestamp.digicert.com \
96+
$CERTCHAIN_ARG \
97+
-certs \
98+
-verbose \
99+
"$file" \
100+
"${{ secrets.AZURE_KEYVAULT_CERT_NAME }}"
101+
102+
if [ $? -eq 0 ]; then
103+
echo "Successfully signed: $file"
104+
else
105+
echo "Failed to sign: $file"
106+
exit 1
107+
fi
94108
else
95-
echo "Failed to sign: $file"
96-
exit 1
109+
echo "Skipping non-IDF JAR: $file"
97110
fi
98111
done
99112
@@ -112,17 +125,13 @@ jobs:
112125
env:
113126
MAVEN_OPTS: "-Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.maxParameterEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.entityExpansionLimit=0"
114127
run: |
115-
# Regenerate P2 metadata to update hashes for signed JARs
116-
# This ensures the SHA-512 hashes in metadata match the signed JAR files
117-
# Use Tycho's fix-artifacts-metadata goal to update metadata without rebuilding artifacts
118128
REPO_DIR="releng/com.espressif.idf.update/target/repository"
119129
120130
echo "Updating P2 metadata for signed JARs in $REPO_DIR..."
121131
mvn -f releng/com.espressif.idf.update/pom.xml \
122132
org.eclipse.tycho:tycho-p2-repository-plugin:fix-artifacts-metadata \
123133
-DrepositoryPath="$REPO_DIR" \
124134
-DskipTests=true || \
125-
# Fallback: try without explicit path (auto-detect)
126135
mvn -f releng/com.espressif.idf.update/pom.xml \
127136
org.eclipse.tycho:tycho-p2-repository-plugin:fix-artifacts-metadata \
128137
-DskipTests=true

0 commit comments

Comments
 (0)