Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
1.01k stars 238 forks source link

Add `.vsix` artifacts to releases on GitHub #722

Open abougouffa opened 2 years ago

abougouffa commented 2 years ago

Hello and thank you for this extension,

I'm using cortex-debug with Emacs (via dap-mode), I want to automate the download process so I can update it from withing Emacs, however, the VSCode workplace do not provide direct links.

Can you please provide the .vsix with the release files (like in v1.5.6-pre1 release)?

I'm working on adding the cortex-debug support to the upstream dap-mode so Emacs users can use it also.

Thank you again

haneefdm commented 2 years ago

Hehehe, I thought I was the last human using Emacs.

Could you not download it from the Marketplace? It may even have an API to download any version while they only show the last few. I only publish on github releases for making a tag and if someone (including myself) want to recreate the source at that point and build/deploy. The build to create a vsix is just a few commands.

image
abougouffa commented 2 years ago

Hehehe, I thought I was the last human using Emacs. 😆 🤣

In fact, VS Marketplace is blocking download requests, direct links works fine from the browser, however, if you try to make a script which automate downloading, it get rejected.

For example, I was facing the same issue with the cpptools extension, which give me sometimes this error (when trying to download it from an Elisp function):

{
  "$id":"1",
  "innerException":null,
  "message":"Request was blocked due to exceeding usage of resource 'Count' in namespace 'AnonymousId'. For more information on why your request was blocked, see the topic \"Rate limits\" on the Microsoft Web site (https://go.microsoft.com/fwlink/?LinkId=823950).",
  "typeName":"Microsoft.TeamFoundation.Framework.Server.RequestBlockedException, Microsoft.TeamFoundation.Framework.Server",
  "typeKey":"RequestBlockedException",
  "errorCode":0,
  "eventId":3000
}

And sometimes this one:

{
  "$id":"1",
  "innerException":null,
  "message":"TF400898: An Internal Error Occurred. Activity Id: e15a6fba-431f-4173-9cc3-cc75cfc27a0c.",
  "typeName":"System.NullReferenceException, mscorlib",
  "typeKey":"NullReferenceException",
  "errorCode":0,
  "eventId":0
}

Hopefully, they are providing .vsix files on GitHub, so I patched the Emacs package to download from it.

Well, the Marketplace works fine as long as you are using VS Code!

haneefdm commented 2 years ago

Okay, I have no issues publishing the VSIX file via github. Except, it is a bunch of extra error-prone work. I am not a git or github expert doing it via the web interface is painful.

Can you/someone provide a script that I can use to publish a release (pre-release or release) on github

  1. It should create a tag from my package.json
  2. Publish the release on github that includes the source zip/tar of the source and the vsix artifacts. This is the part I need REAL HELP with. It should mirror what I would have done normally/manually. I am sure github has an API to do this but...help needed

I can insert/add my commands to create a vsix

I want it to be a process that people can rely on. Not based on dozens of manual steps that I can screw up on.

abougouffa commented 2 years ago

Yep, I can feel the pain!

Unfortunately, I'm not a DevOps expert too, otherwise, I would be happy to do it.

Do not mind, I will find a way to build the extension from source from withing Emacs.

For people who are experienced with GitHub actions/workflow, they can find an inspiration in this file from WebFreak's debug extension.

PhilippHaefele commented 2 years ago

Some time ago i found https://dev.to/sourishkrout/the-github-action-you-need-to-publish-vs-code-extensions-1n8 but didn't had the time to go through it. Maybe this helps with this point and also publishing the releases to the marketplaces

haneefdm commented 2 years ago

Thanks, I will take a look

haneefdm commented 1 year ago

Btw, you can download most of our extensions now from openvsx.org. I will be publishing to both VSCode and OpenVSX simultaneously. But releases only. OpenVSX does not understand pre-releases

haneefdm commented 1 year ago

I do not wish to make releases as a github action as popular as that may be. I think I can use the GH CLI to make a release.

https://cli.github.com/manual/gh_release_create