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

ci: Build the VSCode extension using GitHub Actions #364

Merged
merged 11 commits into from
Apr 19, 2024
23 changes: 0 additions & 23 deletions .bazelci/presubmit.yml

This file was deleted.

1 change: 0 additions & 1 deletion .bazelrc

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/build.yml
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]
vogelsgesang marked this conversation as resolved.
Show resolved Hide resolved

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 }}
3 changes: 0 additions & 3 deletions BUILD

This file was deleted.

16 changes: 3 additions & 13 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@

Most of the releasing is done by [release please](https://github.com/googleapis/release-please), but there are still some manual steps required.

## One-Time Setup

Make sure you have the `vsce` tool installed:

```
$ npm install -g vsce
```

## Create and Test the .vsix Package

Check out the branch of the auto-generated release PR and, run the following command from the directory of the extension source code:

```
$ vsce package
$ npm run package
```

This will compile and bundle the extension into a file named `vscode-bazel-x.y.z.vsix`, where `x.y.z` is the version number of the extension as defined in `package.json`.
Expand All @@ -38,7 +30,5 @@ To deploy the release, merge the auto-generated release PR. This will contain a

We deploy the extension to **two** destinations:

1. We create a .vsix package to upload as a GitHub release, since this is a useful archiving method and it allows users to download and roll back to a previous version of the plugin if necessary. This can be done by anyone who is a maintainer on GitHub. This is done by attaching the `vscode-bazel-x.y.z.vsix` file to the auto-generated release by dragging it or selecting it in the upload box.
2. We publish the extension to the Visual Studio Marketplace so that it can be found in search results and downloaded from Visual Studio Code's Extensions area. This requires publishing rights for the Bazel organization on the Visual Studio Marketplace. Florian Weikert <[email protected]> has handled recent versions.

You can now delete the .vsix file if you wish; it will not be used when publishing to the marketplace.
1. We create a .vsix package to upload as a GitHub release, since this is a useful archiving method and it allows users to download and roll back to a previous version of the plugin if necessary. This is automated by the "Build VS Code extension" GitHub workflow which will automatically run as soon as a new GitHub release gets created.
2. We publish the extension to the Visual Studio Marketplace so that it can be found in search results and downloaded from Visual Studio Code's Extensions area. This is a manual step and requires publishing rights for the Bazel organization on the Visual Studio Marketplace. Florian Weikert <[email protected]> has handled recent versions.
1 change: 0 additions & 1 deletion WORKSPACE

This file was deleted.

Loading