Automated Envato theme deployment with Grunt.js

Wow Grunt is powerful!

Just made a small CSS fix to my theme. Ran grunt build and it:

  • formatted all my code to WordPress standards
  • added correct text domain to all __() and _e() calls
  • generated POT file
  • compressed all images
  • generated .css files from .less (with map file for chrome live editing)
  • added style.css header with current theme details and updated version number
  • looped through all my custom theme-plugins/*, formatted code, text domain, POT, plugin headers, then zipped up each plugin into a theme plugins/ folder ready for TGM activation
  • set the TGM plugin activation array based on settings in a theme.json file
  • saved the change log to the theme.json file for later parsing (documentation / description)
  • built the updated documentation from a mustache template (with new version number and change log) and pushed to gh-pages hosting
  • built the updated item description from a mustache template (with new version number and change log) and saved to HTML file ready for manual item submission.
  • zipped up final WordPress theme into a theme-version.zip file
  • zipped up final WordPress theme, photoshop files, documentation and other resources into a full-download-version.zip file
  • added a ā€œVersion xyz - Dateā€ overlay to the item graphic
  • zipped up new screenshots including the updated item graphic with version number
  • uploaded all these zip files to Envato FTP
  • notifies me when upload is complete so I can login, paste the updated item description, select the zip files and submit for approval.
  • sends the whole thing to github

:wink:

Go learn grunt. Automation can be very powerful.

1 Like

Hey!)

Good stuff, though iā€™m using Gulp instead of Grunt.
Iā€™m also running Python to help me bundle all things up, for example to create placeholders very very fast :slight_smile:

1 Like

Wish I would have started with Gulp. Some things would have been much easier to implement. If I re-write this at any point Iā€™ll use Gulp.

1 Like

:slight_smile: Been doing almost the same thing with Grunt for quite a while.

1 Like

Thanks for sharing these information, i will give a try to that glup or guntā€¦never tried that beforeā€¦any guide will be very helpful

Thanks

I just started learning Grunt over the last few days and wow very powerful. Most of the items on your list I have been curious if Grunt could handle, but not sure where to start.

Would you mind posting in the Gruntfile.js you are using for this setup so we could have a look at the grunt plugins and configuration you are using for this automation.

thanks

And Iā€™m here still learning sass. haha

+1 pretty please ā€¦ :wink:

I was using similar workflow to zip and deploy zip to envato ftp but problem with grunt zip plugin is many times it generates corrupted zip files and one time I had accidently loaded the main corrupted zip. So be sure to check zip before loading :wink:

How was the Grunt code look like for doing the above task?

only ā€œgrunt buildā€ ??

My grunt file is 961 lines long and contains quite a lot of tricks dependant on my dev environment. Iā€™ll try to work up a little example that is worth sharing.

1 Like

Hi @dtbaker,

Please post the file or upload it somewhere we will look into this and pick what needed.

Thanks