I will leave you this code, which can help you to publish automatically all those spreadsheets
function publishSheetsToWeb() {
// Log the name of every file in the user's Drive.
var files = DriveApp.getFiles();
while (files.hasNext()) {
var file = files.next();
// Check if it is a spreadsheet
if(file.getMimeType() === 'application/vnd.google-apps.spreadsheet'){
try{
var fileId = file.getId();
// get the revisions and then get the last one of them
var revisions = Drive.Revisions.list(fileId);
var lastRevisionId = revisions.items[revisions.items.length - 1].id;
// get the resource and set the publish parameters
var resource = Drive.Revisions.get(fileId, lastRevisionId);
resource.published = true;
resource.publishAuto = true;
resource.publishedOutsideDomain = true;
// publish to the web
Drive.Revisions.update(resource, fileId, lastRevisionId);
} catch(err) {
Logger.log(err);
}
}
}
}
Notice
To get the public URLs you can refer to this post
Because you are trying to make public a lot of docs, be careful with the quotas limits. You can learn more about them here