To create Sitecore Package programmatically performs below steps which described by Hishaam Namooya in one of his articles. I am giving you the reference of that article as well:
First step is to create a new Package Project
var packageProject = new PackageProject
PackageName = "Specify the package name",
You can try with Sitecore Powershell Extensions.
Packaging with SPE - https://doc.sitecorepowershell.com/modules/packaging
Then create a task scheduler to run this powershell script - https://doc.sitecorepowershell.com/modules/integration-points/tasks