-
Notifications
You must be signed in to change notification settings - Fork 588
Nightly Build
The nightly build has been deprecated in favor of the pre-release build.
Firstly, you need a Azure Devops organization, which you probably already have as it's necessary for publishing an VS Code extension to the marketplace. Then you need to create a project if you haven't done that yet
Secondly we need to create a build pipeline:
- Link with a git repository
- Choose a template to start from
VS Code extensions are Nodejs applications so we can choose the Nodejs template or an empty one for better customization.
Once we create a build pipeline, the next step is setting up customized tasks, here is an overall look of GH PR nightly build's pipeline
For every task, we need to specific a task runner. We used three different task runners in our pipeline
- Node Tool Installer.
- Yarn Tool Installer as we use Yarn in our project
- Command Line. For all other tasks, we write our own shell scripts.
yarn
yarn vsce
vsce
is necessary here as we are going to publish from command line.
As mentioned at the very beginning, the nightly build will be a new extension, so there are two properties we need to modify
- Extension ID
- Version
Updating the extension id is easy, for example, we change vscode-pull-request-github
to vscode-pull-request-github-insiders
. While updating the version is a bit more complex but still straightforward
- Every nightly build has an unique version
- The version only increments
- We are still able to publish manually
Update. The version will be YEAR.MONTH.MINUTES-IN-MONTH
, so we can generate an unique version for every minute, even if we attempt to publish a new release manually, the version is still guaranteed correct.
To publish through command line, we need to pass in Personal Access Token through Environment Variable again. Apparently we don't want to put the PAT in source code.
The current token has a lifetime of a year, and will expire on 3/11/2021. When this happens, generate a new token using these instructions. From the pipeline's page, click edit, variables, and then update the value of vsce.token
to the new string.
Once we have the build pipeline setup, we can save the configuration in a yml file and push that to our repository (xterm example), but you don't necessarily need to if you have some customized scripts you don't want to expose.
The last step is setting triggers for the pipeline. The one we use for GH PR nightly build is
- Every Mon to Fri 8:00 from master
- Only when there are new commit after the last version
To publish the extension, the pipeline takes a vsce access token as a variable.