ci: Publish vsix to package registry and make release
Issue - [VS Code] Publish vsix file as part of release ... (#1251 - closed)
Description
When we create a new tag of this project, we publish the assets to VS Code Marketplace and Open VSX Marketplace. As we are looking to integrate GitLab Workflow into Remote Development workspace, we want to be able to download the .vsix file and package it directly with our fork of VS Code. Right now, we would have to download it from VS Code Marketplace or Open VSX Marketplace. We plan to install/sideload the GitLab Workflow extension in the workspace even for those customers/users who will not connect to any third-part marketplace. Thus downloading it from a third-party marketplace during build time feels odd(not sure if there are some implicit usage terms we would be agreeing to on behalf of the customers?)
Implementation Details:
We could like to make gitlab release when a new tag is created for this repo, and include the dist-desktop
into the assest.
In order to do this, we first need to publish the built vsix
into the gitlab package registry, so later on we could include them as an assest into the release. I think other registry would work either, but think gitlab package registry should be a good option.
Also we have a new job for generating the changelog via the API, and include it into the desctiption.
- modified npm script
version
, now it will not only insert intoCHANGELOG.md
, but also regenerateRELEASE_NOTES.md
for later use -
make_package
will save thepackage_name
intodotenv
for later job reference - new job
upload_package
, will upload the vsix file frommake_package
into our gitlab package registry - new
make_release
job will create the new release when new tag is created, use the changelog generated above, and also include the asset fordist-desktop
with the link to the package registry
The current CI flow would be like below:
-
make_package
will build the vsix file for later use -
upload_package
will grab the above vsix file, and upload to package registry -
make_release
will use the generated changelog, and also include the link from package registry as an assest
Related Issues
Resolves #[issue_number]
How has this been tested?
Screenshots (if appropriate)
We could see in this folk repo, i added in the changes identical to this MR and merge it into main
, https://gitlab.com/zhaochen_li/gitlab-vscode-extension-1/-/commits/main/?ref_type=HEADS
Then I mimic the flow for us to create a new release,
- update
package.json
to new tag4.20.0
- run
npm install
- run
npm run version
(there are already 2 new commits unreleased since last time) - then push and merge to
main
- create a new tag
v4.20.0
, https://gitlab.com/zhaochen_li/gitlab-vscode-extension-1/-/tags - confirm the package is published into gitlab package regisrty, https://gitlab.com/zhaochen_li/gitlab-vscode-extension-1/-/packages
- confirm the release is also created with correct description and the assest, https://gitlab.com/zhaochen_li/gitlab-vscode-extension-1/-/releases
What CHANGELOG entry will this MR create?
-
fix:
Bug fix fixes - a user-facing issue in production - included in changelog -
feature:
New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:
(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes