Skip to content
43 changes: 43 additions & 0 deletions .github/workflows/nightly-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,49 @@ jobs:
run: |
npx tsx .github/scripts/index.ts ext-github-releases

publish-to-cbweb-marketplace:
name: Publish to CBWeb Internal Marketplace
needs: [package, create-github-releases, calculate-artifact-name]
runs-on: ubuntu-latest
continue-on-error: true
if: >-
needs.package.result == 'success' &&
(inputs.dry-run != 'true' && github.event.inputs.dry-run != 'true')
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.

We want all the steps to be exercised, except for the mutating action. Those actions should be guarded with dry-run.

steps:
- name: Download VSIX artifacts
uses: actions/download-artifact@v8
with:
name: ${{ needs.calculate-artifact-name.outputs.artifact-name }}
path: ./vsix-artifacts

- name: Publish VSIX to CBWeb marketplace
run: |
VSIX_FILE=$(find ./vsix-artifacts -name "*.vsix" | head -1)
if [ -z "$VSIX_FILE" ]; then
echo "::error::No VSIX file found in artifacts"
exit 1
fi
echo "Publishing $VSIX_FILE to CBWeb marketplace..."

HTTP_CODE=$(curl -s -o response.json -w '%{http_code}' \
--retry 2 --retry-delay 5 \
-X POST "${MARKETPLACE_URL}/api/internal/publish" \
-H "Authorization: Bearer ${MARKETPLACE_DEPLOY_TOKEN}" \
-F "vsix=@${VSIX_FILE}")

echo "HTTP response code: $HTTP_CODE"
cat response.json

if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
echo "Successfully published to CBWeb marketplace"
else
echo "::warning::Failed to publish to CBWeb marketplace (HTTP $HTTP_CODE)"
exit 1
fi
env:
MARKETPLACE_URL: ${{ vars.MARKETPLACE_URL }}
MARKETPLACE_DEPLOY_TOKEN: ${{ secrets.MARKETPLACE_DEPLOY_TOKEN }}

slack-notify:
name: Slack Notification
needs:
Expand Down
Loading