Skip to content

Commit c1b3bc8

Browse files
authored
Merge pull request #9 from Zoo-Code-Org/fix-duplicate-release
fix(ci): handle existing Marketplace uploads
2 parents e2bcab1 + 48ab494 commit c1b3bc8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,23 @@ jobs:
272272
run: |
273273
test -n "$PUBLISH_TOKEN"
274274
test -f "build/distributions/ZooCode-${VERSION}.zip"
275-
./gradlew publishPlugin \
275+
# The public updates API hides updates that wait for Marketplace review,
276+
# so the prepare job cannot see a version that was already uploaded. A
277+
# duplicate-version rejection proves the upload exists. Treat only that
278+
# rejection as done. Every other failure must stop the run.
279+
log="$RUNNER_TEMP/publish-plugin.log"
280+
if ! ./gradlew publishPlugin \
276281
-PdebugMode=release \
277282
-PvscodePlugin=zoo-code \
278283
-PpluginVersion="$VERSION" \
279-
--no-configuration-cache
284+
--no-configuration-cache 2>&1 | tee "$log"; then
285+
if grep -Fq "already contains version ${VERSION} in channel" "$log"; then
286+
echo "JetBrains Marketplace already holds Zoo Code ${VERSION}; the update awaits Marketplace review."
287+
exit 0
288+
fi
289+
exit 1
290+
fi
291+
echo "Published Zoo Code ${VERSION} to the default Marketplace channel."
280292
281293
- name: Create or update the GitHub release
282294
env:

0 commit comments

Comments
 (0)