-
Notifications
You must be signed in to change notification settings - Fork 2
Procedure to create releases for Theia
The Theia cpp-debug
extension located here requires the debug adapter to be built, zipped and uploaded somewhere. When the extension is yarn-installed, it fetches and decompresses the adapter.
The approach that was taken so far was to build the adapter (this repo) and upload the artifact as a release on Github. Here are the steps, roughly:
- Make sure to start from a clean repository (
git clean -xfd
). - This would be a good time to make sure you are up to date with upstream. Make sure the master branch on this repo is up-to-date too. Make sure you don't have unexpected commits on top.
- Build with
yarn
. - Pack the files: I use
npm pack
, becauseyarn pack
gives me a strange error that I never had time to debug yet:
$ npm pack
npm notice
npm notice 📦 cdt-gdb-vscode@0.0.61
npm notice === Tarball Contents ===
npm notice 4.2kB package.json
npm notice 130B .vscodeignore
npm notice 14.2kB LICENSE
npm notice 742B README.md
npm notice 473B tsconfig.json
npm notice 175.3kB yarn.lock
npm notice 619B .vscode/launch.json
npm notice 379B .vscode/tasks.json
npm notice 1.1kB src/extension.ts
npm notice === Bundled Dependencies ===
npm notice cdt-gdb-adapter
npm notice === Tarball Details ===
npm notice name: cdt-gdb-vscode
npm notice version: 0.0.61
npm notice filename: cdt-gdb-vscode-0.0.61.tgz
npm notice package size: 185.9 kB
npm notice unpacked size: 685.6 kB
npm notice shasum: bedfcc974c9b50c8572be0e9db3c5cff3a730a30
npm notice integrity: sha512-lT2QcLnB4qtMp[...]OwkanAW+/3dHg==
npm notice bundled deps: 1
npm notice bundled files: 93
npm notice own files: 9
npm notice total files: 102
npm notice
cdt-gdb-vscode-0.0.61.tgz
$ yarn pack
yarn pack v1.12.3
error An unexpected error occurred: "Cannot find module \".\"".
info If you think this is a bug, please open a bug report with the information provided in "/home/emaisin/src/cdt-gdb-vscode/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/pack for documentation about this command.
- Go to the New release page.
- Fill the fields:
- For
Tag Version
andRelease Title
, I use the version (e.g.v0.0.61
). -
Target
staysmaster
. - Attach the
.tgz
created bynpm pack
.
- For
- Click
Publish Release
! - Give yourself a pat on the back, this is a good release.
The above procedure works by pulling the latest cdt-gdb-adapter
package from npm. In case the package does not contain the latest changes from its GitHub project, we can follow the procedure below:
-
Make sure to start from a clean repository (
git clean -xfd
). -
Create and checkout a release branch:
git checkout -b release/<release-name>
-
Clone the
cdt-gdb-adapter
sources in this branch:git submodule add https://github.com/eclipse-cdt/cdt-gdb-adapter.git
-
Add the following script to
cdt-gdb-vscode
's package.json file:"scripts": { "preinstall": "cd cdt-gdb-adapter && yarn && yarn build && yarn pack --filename cdt-gdb-adapter.tgz", }
-
Change the
cdt-gdb-adapter
dependency constraint to the archive that will be packed on install:"dependencies": { "cdt-gdb-adapter": "file:cdt-gdb-adapter/cdt-gdb-adapter.tgz", }
-
Push your release branch to GitHub.
-
Build and pack
cdt-gdb-vscode
:yarn yarn build npm pack # `yarn pack` fails for some reason
-
Go to the New release page.
-
Fill the fields:
- For
Tag Version
andRelease Title
, I use the version and a tag (e.g.v0.0.61-theia.1
). - Point
Target
to your release branch. - Attach the
.tgz
created bynpm pack
.
- For
-
Click
Publish Release
!