File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed
Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -36,23 +36,21 @@ jobs:
3636 env :
3737 GITHUB_TOKEN : ${{ github.token }}
3838
39- - name : Upload VSIX to Package-Specific Release
40- if : steps.changesets.outputs.published == 'true'
39+ - name : Check if VSCode Extension version is unpublished on Open VSX
40+ id : check-open-vsx
4141 shell : bash
42- env :
43- GITHUB_TOKEN : ${{ github.token }}
4442 run : |
45- PACKAGE_NAME="urlspec-vscode-extension"
46- VERSION=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r ".[] | select(.name == \"$PACKAGE_NAME\") | .version")
47-
48- if [ -n "$VERSION" ] && [ "$VERSION" != "null" ]; then
49- TAG_NAME="$PACKAGE_NAME@$VERSION"
50- echo "Target Tag: $TAG_NAME"
51-
52- cd packages/$PACKAGE_NAME
43+ VERSION=$(node -p "require('./packages/urlspec-vscode-extension/package.json').version")
44+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://open-vsx.org/api/daangn/urlspec-vscode-extension/$VERSION")
45+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
46+ echo "unpublished=$([ "$HTTP_STATUS" = "404" ] && echo 'true' || echo 'false')" >> "$GITHUB_OUTPUT"
5347
54- VSIX_FILE=$(ls *.vsix)
55- gh release upload "$TAG_NAME" "$VSIX_FILE" --clobber
56- else
57- echo "No update for $PACKAGE_NAME in this release."
58- fi
48+ - name : Publish to Open VSX Registry
49+ if : steps.check-open-vsx.outputs.unpublished == 'true'
50+ shell : bash
51+ env :
52+ OVSX_PAT : ${{ secrets.OPEN_VSX_TOKEN }}
53+ run : |
54+ cd packages/urlspec-vscode-extension
55+ VSIX_FILE=$(ls *.vsix)
56+ npx ovsx publish "$VSIX_FILE" --pat "$OVSX_PAT"
You can’t perform that action at this time.
0 commit comments