Continuous Deployment Demo Extension
This repo exists to demonstrate how to use GitHub Actions to run continuously deploy your VS Code extension. It can both:
- Publish a stable release to the marketplace and GitHub's release page when a new tag is pushed
- Publish a nightly release to the marketplace and an artifact to the runner Action on a set schedule (nightly by default). A vNightly branch is created to track the latest nightly build.
Start by generating a Marketplace PAT by following the instructions here. Then add it as a repository secret with name MARKETPLACE_PAT
(instructions).
Next, copy .github/workflows/cd-stable.yml
to your extension push it to GitHub, then create releases via:
VERSION=$(node -e "console.log(require('./package.json').version)")
git tag v$VERSION
git push origin v$VERSION
Note: The Action as written assumes your extension can be built via npm i && vsce package
, if this is not the case some modifications to the Action will be required.
Nightly Build
To enable a nightly build copy .github/workflows/cd-nightly.yml
to your extension push it to GitHub, then releases will be created automatically every day that chanages are made, or manually via:
curl --location --request POST 'https://api.github.com/repos/[Your Extension]/dispatches' \
--header 'Authorization: Bearer [GitHub PAT with push rights to the repo]' \
--header 'Content-Type: text/plain' \
--data-raw '{ "event_type": "trigger-nightly-publish" } '
Note: The Action as written assumes your nightly build is simply your stable build with some packaage.json entries modified, if this is not the case some modifications to the Action will be required.