Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@W-16971261 Create publishing workflow #134

Merged
merged 3 commits into from
Nov 14, 2024
Merged
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
47 changes: 47 additions & 0 deletions .github/workflows/publishVSCode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish VSCode Extension

on:
release:
types: [released]
pull_request:
branches: ['**']

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'

- name: Install Dependencies
run: npm install

- name: Build and Package Extension
id: package
run: |
npm run compile && npm run vscode:package
# Check if .vsix file exists
if [ -f "$(ls *.vsix)" ]; then
echo "VSIX_FILE=$(ls *.vsix)" >> $GITHUB_OUTPUT
echo "Package created successfully"
else
echo "Failed to create VSIX package"
exit 1
fi

- name: Publish Extension
if: success() && steps.package.outputs.VSIX_FILE && github.event_name == 'release'
run: |
if npx vsce publish --pat "${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}"; then
echo "✅ Successfully published extension to marketplace"
else
echo "❌ Failed to publish extension"
exit 1
fi
env:
VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}