{"id":728,"date":"2021-08-27T13:50:59","date_gmt":"2021-08-27T13:50:59","guid":{"rendered":"https:\/\/mklasen.com\/?p=728"},"modified":"2022-11-21T16:04:50","modified_gmt":"2022-11-21T16:04:50","slug":"github-action-automatically-add-a-zip-asset-for-each-new-release","status":"publish","type":"post","link":"https:\/\/mklasen.com\/github-action-automatically-add-a-zip-asset-for-each-new-release\/","title":{"rendered":"Github action: Automatically add a ZIP asset for each new release"},"content":{"rendered":"\n

The code below will automatically create a new asset for each new release that you publish on Github. Add it to your repository in a .github\/workflow\/<\/code> folder and experience the magic yourself!<\/p>\n\n\n\n

Update: I’ve also setup a sample repository with working code here<\/strong>:<\/p>\n\n\n\n

https:\/\/github.com\/mklasen\/zip-creation-github-action<\/a><\/p>\n\n\n\n

Direct link to the workflow file: https:\/\/github.com\/mklasen\/zip-creation-github-action\/blob\/master\/.github\/workflows\/release-action.yml<\/a><\/p>\n\n\n\n

After a new release is created, a ZIP file will be added to the new release after the action ran, see an example release here: https:\/\/github.com\/mklasen\/zip-creation-github-action\/releases\/tag\/v4<\/a><\/p>\n\n\n\n

Original example code<\/h2>\n\n\n\n

Note: this snippet is created for PHP based repositories that user composer. If your repository does not use composer then you should remove the steps on line 15, 19 and 26<\/em> and customize the script to your needs.<\/p>\n\n\n\n