-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Build the VSCode extension using GitHub Actions (#364)
This commit adds a Github action which builds the VS Code extension. The .vsix file is uploaded as an artifact such that it can be easily downloaded from GitHub (in the "Artifacts" section of the action's summary page). Those artifacts are also uploaded as part of pull requests, which makes it easier to quickly download, install and test the extension built from a pull request. In addition, if the workflow is triggered because a new release was tagged, the .vsix is also attached as an artifact to the newly created release. As part of this change, the `vsce` tool is now listed as a devDependency and thereby its exact version is now part of the `package-lock.json`, making the packaging step more reproducible. The new, recommend way to package the extension is now `npm run package`. Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com> Co-authored-by: Cameron Martin <cameronmartin123@gmail.com>
- Loading branch information
1 parent
af00440
commit 8972b0e
Showing
8 changed files
with
2,143 additions
and
52 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build VS Code extension | ||
|
||
on: | ||
push: | ||
pull_request: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
# Write permissions needed for publishing the release | ||
contents: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_vscode_ext: | ||
name: Build VS Code extension | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: "npm" | ||
|
||
- name: Install Javascript dependencies | ||
run: npm ci | ||
|
||
- name: Check formatting | ||
run: npm run format-check | ||
|
||
# Has to happen before `check-lint`, because we need the generated protobuf types | ||
- name: Compile the extension | ||
run: npm run compile | ||
|
||
- name: Lint | ||
run: npm run check-lint | ||
|
||
- name: Package VS Code extension | ||
run: npm run package | ||
|
||
- name: Upload Workflow Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: vscode-bazel-prerelease.vsix | ||
path: vscode-bazel-*.vsix | ||
if-no-files-found: error | ||
|
||
- name: Upload Release Artifact | ||
if: ${{ github.event_name == 'release' }} | ||
shell: bash | ||
run: | | ||
filename=`echo vscode-bazel-*.vsix`; | ||
gh release upload ${{ github.event.release.tag_name }} "$filename" | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.