Documentation to add Arduino support for custom Boards

I am currently building a small board with a SAMD21G17 micro-controller on board.

This is exactly the same chip as in the Arduino Zero (SAMD21J18) only with fewer pins and lesser memory. I have been looking all over to find the procedure to add your own board variant to the arduino IDE but have not found comprehensive documentation as to how to achieve this. Could someone please point me in the right direction.

Thanks in advance,

And if you want to add Boards Manager install support:

I'd recommend installing the Arduino SAMD Boards in Tools > Board > Boards Manager and use the files in Arduino15/packages/arduino/hardware/samd as a reference.

Thanks , that helps a lot ! I will post back here when I have something fully working