waldo1001 / crs-al-language-extension

Make working with the (Dynamics NAV / 365) AL Language easier and more efficient.
MIT License
34 stars 43 forks source link

Adding CI/CD #233

Closed christianbraeunlich closed 2 years ago

christianbraeunlich commented 2 years ago

This (Draft) PR attempts to add a CI/CD pipeline to this project.

This includes the following tasks:

What do you think? (Here is a first test run https://github.com/christianbraeunlich/crs-al-language-extension/actions/runs/2309049391)

waldo1001 commented 2 years ago

I remember that I spent quite some time on it back in the days (in DevOps) .. but my knowledge in anything typescript is limited .. too limited back then.

that said - would LOVE to look into that again!

On top of that - It would be awesome that it would also run the tests ;-).

christianbraeunlich commented 2 years ago

I'm totally with you on that point. Maybe we can discuss a few things before we add this to the main release - especially for the release/launch step, I would want to know how you want to handle this.

waldo1001 commented 2 years ago

Let's do that! Totally appreciate your contribution on this - it's been too busy for me to do anything useful lately, so this is very much appreciated!

christianbraeunlich commented 2 years ago

The artifact is +12 MB... ~I need to provide a .vscodeignore file to reduce the size.~

EDIT#1: It's already existing. However the node_modules directory wasn't covered. EDIT#2: The images/SearchGoogleDocs.gif file takes up to +11MB. We should consider decreasing it's size.

waldo1001 commented 2 years ago

Woopsie ..

I was able to reduce it - it's in the master branch!

christianbraeunlich commented 2 years ago

Here's a brief introduction to what the workflow is doing: a) Whenever there is a push into this repo the pipeline gets triggered and runs Lint, Test and Build. b) Whenever there is a push of a tag to the repo it will now also get into the Release job which involves the following steps:

  1. checking the tag (e.g. v1.5.6) matching the version number in the package.json (e.g. "version": "1.5.6"). In this case there is a match and the pipeline continues (otherwise an error will occure).
  2. The vs-code package will be published to the marketplace
  3. Reading the section from the changelog.md file with all the lines underneath e.g. [1.5.6] - dd.MM.yy
  4. Creating a GitHub Release and storing the changelog section into that body.
  5. Upload the artifact to the GitHub release

Requirement:

What do you think of the current state of the pipeline? We could optimize it along the road or implement some changes right away. Let me know if this is what you've had in mind. We are now triggering the release/publish process manually by pushing a tag to the repository.

christianbraeunlich commented 2 years ago

I changed the state back to Draft as I think we should spend a bit more time on this.

In the meantime I create a sample project to have some sort of playground for myself. Have a look at the workflow "Create Release" (https://github.com/christianbraeunlich/chewbacca/actions/workflows/createRelease.yml). This would make it possible to create a release manually from GitHub.

As I'm not happy with the workflows atm, I will spend some more time on them next week :)

waldo1001 commented 2 years ago

Already looking pretty good - you need anything from me?

christianbraeunlich commented 2 years ago

Already looking pretty good - you need anything from me?

You could create a PAT in Azure DevOps with Marketplace rights and put that into a secret (e.g. called "VSCE_TOKEN") for this repository.

I'll get to this PR next week as I'm moving into a new apartment this week.

waldo1001 commented 2 years ago

Already looking pretty good - you need anything from me?

You could create a PAT in Azure DevOps with Marketplace rights and put that into a secret (e.g. called "VSCE_TOKEN") for this repository.

I'll get to this PR next week as I'm moving into a new apartment this week.

VSCE_TOKEN has been added!

christianbraeunlich commented 2 years ago

Yeah, still potential for improvements - feel free to review. Want to create the first release together just pm me via discord