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

Publish VSCode Extension to the Marketplace #142

Merged
merged 2 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
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
25 changes: 14 additions & 11 deletions .github/workflows/vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: VSCode Extension

on:
pull_request:
branches:
- main
paths:
- 'taqueria-vscode-extension/**'
push:
tags:
- v*
Expand All @@ -25,15 +25,14 @@ jobs:
matrix:
os:
- ubuntu-latest
# TODO: Uncomment once we make repo public
## private repos have usage limits for github hosted runners
# - macos-latest
# - windows-latest
- macos-latest
- windows-latest
defaults:
run:
working-directory: ${{ env.VSCODE_DIR }}
outputs:
artifactFilename: ${{ steps.setArtifactFilename.outputs.filename }}
vsixPath: ${{ steps.packageExtension.outputs.vsixPath }}
steps:
- name: Checkout Source
uses: actions/checkout@v2
Expand All @@ -59,15 +58,17 @@ jobs:
run: xvfb-run -a npm test
if: runner.os == 'Linux'
- name: Package VSCode Extension
if: runner.os == 'Linux'
id: packageExtension
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: stub
dryRun: true
packagePath: ${{ env.VSCODE_DIR }}
- id: setArtifactFilename
run: echo "::set-output name=filename::taqueria-vscode-${{ github.head_ref || github.ref_name }}-${{ runner.os }}.vsix"
run: echo "::set-output name=filename::taqueria-vscode-${{ github.head_ref || github.ref_name }}-${{ runner.os }}"
- name: Upload Extension Package as Artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: ${{ steps.setArtifactFilename.outputs.filename }}
Expand All @@ -76,12 +77,14 @@ jobs:

publish-marketplace:
name: Publish VSCode Extension
# TODO: uncomment before merging to master
# if: github.ref_type == 'tag'
if: github.ref_type == 'tag'
needs:
- lint-test-build
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ${{ env.VSCODE_DIR }}
steps:
- name: Checkout Source
uses: actions/checkout@v2
Expand All @@ -91,15 +94,15 @@ jobs:
node-version: 16
- name: Install Dependencies
run: npm ci
working-directory: ${{ env.VSCODE_DIR }}
- name: Download Build Artifact
uses: actions/download-artifact@v2
with:
name: ${{ needs.lint-test-build.outputs.artifactFilename }}
path: ${{ env.VSCODE_DIR }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSCE_PAT }}
extensionFile: ${{ needs.lint-test-build.outputs.artifactFilename }}
extensionFile: ${{ needs.lint-test-build.outputs.vsixPath }}
registryUrl: https://marketplace.visualstudio.com
preRelease: true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions taqueria-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"author": "ECAD Labs",
"license": "Apache-2.0",
"icon": "images/taqueria-icon.png",
"repository": {
"type": "git",
"url": "git+https://github.com/ecadlabs/taqueria.git"
Expand Down