Skip to content

Commit

Permalink
Update deployment workflows
Browse files Browse the repository at this point in the history
This commit
1. changes to use vsce and ovsx directly to for publishing
2. adds a step to create and upload the vsix package as GH release

The reason for the update:
1. Using vsce and ovsx directly allows us to control the version of them
2. People can download the vsix and install it directly
  • Loading branch information
stevenguh committed Sep 18, 2021
1 parent 3eb1d5e commit 2ca89d1
Show file tree
Hide file tree
Showing 3 changed files with 1,429 additions and 73 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,40 @@ jobs:

- name: Test
run: xvfb-run -a npm run test

- name: Package
id: package
run: |
npx vsce package;
echo ::set-output name=vsix_path::$(ls *.vsix)
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v0
id: publishToOpenVSX
- name: Create release on GitHub
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
pat: ${{ secrets.OVSX_TOKEN }}
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v0
- name: Upload .vsix as release asset to GitHub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
packagePath: ''
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.package.outputs.vsix_path }}
asset_name: ${{ steps.package.outputs.vsix_path }}
asset_content_type: application/zip

- name: Publish to VSCode Extension Marketplace
run: npx vsce publish --packagePath ${{ steps.package.outputs.vsix_path }}
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}

- name: Publish to Open VSX Registry
run: npx ovsx publish ${{ steps.package.outputs.vsix_path }}
env:
OVSX_PAT: ${{ secrets.OVSX_TOKEN }}
Loading

0 comments on commit 2ca89d1

Please sign in to comment.