diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ad4107..94ad1da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -198,9 +198,22 @@ jobs: - name: Publish VS Code extension to Marketplace if: ${{ steps.publish.outputs.published == 'true' && env.VSCE_PAT != '' }} - run: npx --yes @vscode/vsce publish --packagePath "${{ steps.vsix.outputs.path }}" --pat "$VSCE_PAT" + continue-on-error: true env: VSCE_PAT: ${{ secrets.VSCE_PAT }} + run: | + set +e + OUT=$(npx --yes @vscode/vsce publish --packagePath "${{ steps.vsix.outputs.path }}" --pat "$VSCE_PAT" 2>&1) + CODE=$? + echo "$OUT" + if [ $CODE -eq 0 ]; then + exit 0 + fi + if echo "$OUT" | grep -qiE "already exists|already published"; then + echo "ℹ Already published at this version — treating as success." >> $GITHUB_STEP_SUMMARY + exit 0 + fi + exit $CODE - name: Notice — VS Code Marketplace skipped if: ${{ steps.publish.outputs.published == 'true' && env.VSCE_PAT == '' }} @@ -210,9 +223,22 @@ jobs: - name: Publish to Open VSX if: ${{ steps.publish.outputs.published == 'true' && env.OVSX_PAT != '' }} - run: npx --yes ovsx publish "${{ steps.vsix.outputs.path }}" --pat "$OVSX_PAT" + continue-on-error: true env: OVSX_PAT: ${{ secrets.OVSX_PAT }} + run: | + set +e + OUT=$(npx --yes ovsx publish "${{ steps.vsix.outputs.path }}" --pat "$OVSX_PAT" 2>&1) + CODE=$? + echo "$OUT" + if [ $CODE -eq 0 ]; then + exit 0 + fi + if echo "$OUT" | grep -qiE "already exists|already published|version.*exists"; then + echo "ℹ Already published at this version — treating as success." >> $GITHUB_STEP_SUMMARY + exit 0 + fi + exit $CODE - name: Notice — Open VSX skipped if: ${{ steps.publish.outputs.published == 'true' && env.OVSX_PAT == '' }} diff --git a/.gitignore b/.gitignore index e988e39..c9e5c8b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ coverage .env.local .env.*.local .tokenometer-cache +packages/vscode/*.vsix diff --git a/packages/vscode/package.json b/packages/vscode/package.json index c00dee9..a1252e3 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -1,6 +1,6 @@ { "name": "tokenometer-vscode", - "version": "0.0.3", + "version": "0.1.0", "displayName": "Tokenometer", "description": "Tokenometer for VS Code / Cursor — live token count and USD cost in the status bar for LLM prompts (Claude, GPT-4o, Gemini, Mistral, Cohere).", "publisher": "faraa2m", diff --git a/packages/vscode/tokenometer-vscode-0.0.3.vsix b/packages/vscode/tokenometer-vscode-0.0.3.vsix deleted file mode 100644 index 07fde92..0000000 Binary files a/packages/vscode/tokenometer-vscode-0.0.3.vsix and /dev/null differ