Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/actions/publish-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,26 @@ runs:
exit 1
fi
publish_with_retry() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use salesforcecli/github-workflows/.github/actions/retry@main?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's meant for running a command. Wasn't quite sure how to get it inside a giant bash script without redoing the whole thing (prerelease calc, etc) since those are part of the giant script instead of gha workflow steps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah not a fan of big bash either, we can leave this in for now.

local attempt
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
if "$@"; then
return 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Publish failed; retrying in 15s..."
sleep 15
fi
done
return 1
}
if [ "${{ inputs.publish-tool }}" = "vsce" ]; then
export VSCE_PAT="${!TOKEN_ENV}" # ensure the expected env var is set
npx @vscode/vsce publish --packagePath "${{ inputs.vsix-path }}" --skip-duplicate $PRE_RELEASE_FLAG
publish_with_retry npx @vscode/vsce publish --packagePath "${{ inputs.vsix-path }}" --skip-duplicate $PRE_RELEASE_FLAG
else
npx ovsx publish "${{ inputs.vsix-path }}" -p "${!TOKEN_ENV}" --skip-duplicate $PRE_RELEASE_FLAG
publish_with_retry npx ovsx publish "${{ inputs.vsix-path }}" -p "${!TOKEN_ENV}" --skip-duplicate $PRE_RELEASE_FLAG
fi
PUBLISH_EXIT_CODE=$?
Expand Down
19 changes: 17 additions & 2 deletions .github/actions/vscode/publish-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,26 @@ runs:
exit 1
fi

publish_with_retry() {
local attempt
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
if "$@"; then
return 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Publish failed; retrying in 15s..."
sleep 15
fi
done
return 1
}

if [ "${{ inputs.publish-tool }}" = "vsce" ]; then
export VSCE_PAT="${!TOKEN_ENV}" # ensure the expected env var is set
npx @vscode/vsce publish --packagePath "${{ inputs.vsix-path }}" --skip-duplicate $PRE_RELEASE_FLAG
publish_with_retry npx @vscode/vsce publish --packagePath "${{ inputs.vsix-path }}" --skip-duplicate $PRE_RELEASE_FLAG
else
npx ovsx publish "${{ inputs.vsix-path }}" -p "${!TOKEN_ENV}" --skip-duplicate $PRE_RELEASE_FLAG
publish_with_retry npx ovsx publish "${{ inputs.vsix-path }}" -p "${!TOKEN_ENV}" --skip-duplicate $PRE_RELEASE_FLAG
fi

echo "✅ Successfully published to $MARKETPLACE_NAME"
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/openvsx-publish-release-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ jobs:
IDEE_OVSX_PAT: ${{ secrets.IDEE_OVSX_PAT }}
PRE_RELEASE: ${{ steps.release.outputs.pre-release }}
run: |
# Open VSX can hang the same way as vsce; retry per VSIX.
# --skip-duplicate makes a retry a no-op if the first attempt committed.
publish_with_retry() {
local attempt
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
if "$@"; then
return 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Publish failed; retrying in 15s..."
sleep 15
fi
done
return 1
}

while IFS= read -r -d '' vsix; do
args=("$vsix" -p "$IDEE_OVSX_PAT" --skip-duplicate)
pre_release_suffix=''
Expand All @@ -49,5 +66,8 @@ jobs:
continue
fi

npx ovsx publish "${args[@]}"
if ! publish_with_retry npx ovsx publish "${args[@]}"; then
echo "::error::Failed to publish $vsix after 3 attempts"
exit 1
fi
done < <(find extensions -type f -name '*.vsix' -print0)
22 changes: 20 additions & 2 deletions .github/workflows/vscode-promote-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,24 @@ jobs:
REPO="${{ github.repository }}"
FAILED=0

# Marketplace gallery requests can sit until typed-rest-client's 180s
# socket timeout. vsce/ovsx have no timeout flag; retry per VSIX.
# --skip-duplicate makes a retry a no-op if the first attempt committed.
publish_with_retry() {
local attempt
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
if "$@"; then
return 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Publish failed; retrying in 15s..."
sleep 15
fi
done
return 1
}

for VSIX in "${VSIX_FILES[@]}"; do
NAME=$(basename "$VSIX")
echo "::group::$NAME → $MARKETPLACE_NAME"
Expand All @@ -213,14 +231,14 @@ jobs:
fi

if [ "$PUBLISH_TOOL" = "vsce" ]; then
if VSCE_PAT="$TOKEN" npx @vscode/vsce publish --packagePath "$VSIX" --skip-duplicate --pre-release; then
if VSCE_PAT="$TOKEN" publish_with_retry npx @vscode/vsce publish --packagePath "$VSIX" --skip-duplicate --pre-release; then
echo "✅ Published $NAME to $MARKETPLACE_NAME"
else
echo "::error::Failed to publish $NAME to $MARKETPLACE_NAME"
FAILED=1
fi
else
if npx ovsx publish "$VSIX" -p "$TOKEN" --skip-duplicate --pre-release; then
if publish_with_retry npx ovsx publish "$VSIX" -p "$TOKEN" --skip-duplicate --pre-release; then
echo "✅ Published $NAME to $MARKETPLACE_NAME"
else
echo "::error::Failed to publish $NAME to $MARKETPLACE_NAME"
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/vscode-publish-release-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ jobs:
PRE_RELEASE: ${{ steps.release.outputs.pre-release }}
VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}
run: |
# Marketplace gallery requests can sit until typed-rest-client's 180s
# socket timeout. vsce has no timeout flag; retry per VSIX.
# --skip-duplicate makes a retry a no-op if the first attempt committed.
publish_with_retry() {
local attempt
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
if "$@"; then
return 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Publish failed; retrying in 15s..."
sleep 15
fi
done
return 1
}

while IFS= read -r -d '' vsix; do
args=(--packagePath "$vsix" --skip-duplicate)
if [ "$PRE_RELEASE" = true ]; then
Expand All @@ -47,5 +65,8 @@ jobs:
continue
fi

VSCE_PAT="$VSCE_PERSONAL_ACCESS_TOKEN" npx @vscode/vsce publish "${args[@]}"
if ! VSCE_PAT="$VSCE_PERSONAL_ACCESS_TOKEN" publish_with_retry npx @vscode/vsce publish "${args[@]}"; then
echo "::error::Failed to publish $vsix after 3 attempts"
exit 1
fi
done < <(find extensions -type f -name '*.vsix' -print0)
16 changes: 14 additions & 2 deletions .github/workflows/vscode-release-explicit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ jobs:
PRE_RELEASE_FLAG: ${{ inputs.pre-release && '--pre-release' || '' }}
run: |
cd "$EXTENSION"
npx vsce publish $PRE_RELEASE_FLAG

@madhur310 madhur310 Sep 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need -skip-duplicate flag now right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so? It didn't before this PR, either, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but probably should now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added --skip-duplicate on both vsce and ovsx in this path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a vscode-release-explicit.yml run failed because the marketplace call hung/timed out but had actually gone through server-side, and someone manually reran that job, the rerun would already hit "version already exists" — same root cause, same missing flag. This PR didn't introduce that gap; it's been there as long as this workflow has lacked --skip-duplicate

ok=0
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
npx vsce publish --skip-duplicate $PRE_RELEASE_FLAG && { ok=1; break; }
[ "$attempt" -lt 3 ] && sleep 15
done
[ "$ok" -eq 1 ]

- name: Publish to Open VSX
if: |
Expand All @@ -148,7 +154,13 @@ jobs:
PRE_RELEASE_FLAG: ${{ inputs.pre-release && '--pre-release' || '' }}
run: |
cd "$EXTENSION"
npx ovsx publish $PRE_RELEASE_FLAG -p "$OVSX_PAT"
ok=0
for attempt in 1 2 3; do
echo "Publish attempt ${attempt}/3"
npx ovsx publish --skip-duplicate $PRE_RELEASE_FLAG -p "$OVSX_PAT" && { ok=1; break; }
[ "$attempt" -lt 3 ] && sleep 15
done
[ "$ok" -eq 1 ]

- name: Prepare artifact name
id: artifact
Expand Down