Skip to content

Commit

Permalink
Set up CI job to publish the vscode extension (#1759)
Browse files Browse the repository at this point in the history
* ci: Set up CI job to publish the vscode extension

* ci: Fixed test.yml
  • Loading branch information
shd101wyy authored Sep 14, 2023
1 parent 233d7e1 commit 695a9e6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Publish the extension."
on:
push:
branches:
- master
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Install nodejs 18'
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: |
corepack enable
yarn install
- name: Build
run: yarn run build
- name: Get current package version
id: package_version
uses: martinbeentjes/npm-get-version-action@v1.1.0
- name: Publish extension to Visual Studio Marketplace
id: create_vsix
uses: HaaLeo/publish-vscode-extension@v1
with:
dryRun: ${{ github.ref != 'refs/heads/master' }}
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
- name: Create a Release
if: github.ref == 'refs/heads/master'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name : ${{ steps.package_version.outputs.current-version}}
release_name: ${{ steps.package_version.outputs.current-version}}
body: Published ${{ steps.package_version.outputs.current-version}}
- name: Attach vsix to release
if: github.ref == 'refs/heads/master'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.create_vsix.outputs.vsixPath}}
asset_name: ${{ steps.create_vsix.outputs.vsixPath}}
asset_content_type: application/vsix
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
4 changes: 3 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ node_modules
.prettierignore
build.js
prettier.config.js
.eslintrc.js
.eslintrc.js
.husky
gulpfile.js

0 comments on commit 695a9e6

Please sign in to comment.