I have created recently a tool with modelbuilder and I wanted to share it on arcgis online or a web server.
So I spent a week to tried but without any useful result.
Any help would be appreciated.
You would need an ArcGIS Enterprise (GIS Server) to publish the tool as a Geoprocessing Service first, then bring it to the Geoprocessing widget of Web Appbuilder. Geoprocessing widget—ArcGIS Web AppBuilder | Documentation
I can't think of an out-of-the-box alternative to this, if you don't have an ArcGIS Enterprise license.
What functionality do you want to achieve? You could check if a similar functionality can be achieved through ArcGIS Python API or JS API or Esri provided Geoprocessing services.