{"id":17693121,"url":"https://github.com/toolstack/git-to-wp-plugin-dir-release-script","last_synced_at":"2025-05-13T03:17:31.375Z","repository":{"id":85642271,"uuid":"49220973","full_name":"toolstack/git-to-wp-plugin-dir-release-script","owner":"toolstack","description":"A release script that takes a git repo tag and pushes it to the WordPress Plugin directory SVN.","archived":false,"fork":false,"pushed_at":"2017-01-28T21:26:30.000Z","size":38,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T03:17:25.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toolstack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-07T17:58:21.000Z","updated_at":"2020-01-17T12:29:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"d07fab36-af23-4f8c-a88b-91e3c78b7ed0","html_url":"https://github.com/toolstack/git-to-wp-plugin-dir-release-script","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolstack%2Fgit-to-wp-plugin-dir-release-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolstack%2Fgit-to-wp-plugin-dir-release-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolstack%2Fgit-to-wp-plugin-dir-release-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toolstack%2Fgit-to-wp-plugin-dir-release-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toolstack","download_url":"https://codeload.github.com/toolstack/git-to-wp-plugin-dir-release-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253863173,"owners_count":21975596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T13:44:14.577Z","updated_at":"2025-05-13T03:17:31.355Z","avatar_url":"https://github.com/toolstack.png","language":"PHP","readme":"# GIT to WordPress Plugin Directory Release Script\n\nWordPress plugins are often hosted on GitHub or other GIT repositories for development purposes but then pushed to the WordPress Plugin SVN infrastructure for release in the Plugin Directory.\n\nThis script automates the process with a php script intended to be run from a Unix shell or Windows command prompt.\n\nThis script was originally based on [code](https://github.com/WP-API/WP-API/blob/develop/bin/release.sh) from the [WP-API](https://github.com/WP-API/WP-API) project.\n\n## Installation\n\nThe basic script should work for simple plugins without alteration.  The script is intended to be run from outside of your plugin repo and so requires very few changes to your current repo to work.\n\nIn it's simplest form you can do the following steps:\n\n1. Clone your plugin GIT repo to your local system, let's say to /source/plugin-slug, for example.\n2. Clone the release script to /source/git-to-wp-plugin-dir-release-script.\n3. Start a shell and go to /source/git-to-wp-plugin-dir-release-script.\n4. Run `php release.php plugin-slug tag`, where tag is the release tag you want to push to wordpress.org.\n\n## Usage\n\nThe script is intended to be run from it's own repo directory, you do not have to add it to your plugin's repo.\n\nThe script has two parameters:\n\n1. Plugin slug/path.\n2. Tag to release.\n\nTo do a release, do the following:\n\n1. Tag a release in your GIT repo.\n2. Change in to the \"git-to-wp-plugin-dir-release-script\" directory.\n3. Run \"php release.php plugin-slug TAG\" (where TAG is usually something like 1.2 or 4.5 etc.)\n\nThe script will do several things and then ask for confirmation to commit the changes to the SVN tree.\n\nAt this time you have the opportunity to verify what will be commit, the working copy will be in your system's temporary directory.\n\nIf everything is ok, you MUST type in \"YES\", all in capitals and then hit enter.\n\nThe script will then commit the changes to the SVN tree and you may be prompted for your SVN password (possibly twice, once for the commit and once for the tag).\n\n## Configuration\n\nFor the script to work, you must have three things accessible on your system's shell:\n\n1. PHP\n2. GIT\n3. SVN\n\nIdeally, these should be available in your path, however only PHP has that requirement, you can configured a path for both GIT and SVN.\n\nThe script uses a \"release.ini\" file to store several configuration variables to use, which will be explained shortly.\n\nThe script actually uses several release.ini files, to form it's configuration to allow for a mix of defaults, site specific and project specific overrides.\n\nThree release.ini files are looked for in the following directories:\n\n1. in the git-to-wp-plugin-dir-release-script repo directory (the defaults)\n2. in the parent directory of git-to-wp-plugin-dir-release-script (the local site settings)\n3. in the plugin repo's directory (it can be in either the bin, release or root directory of the repo)\n\nThese ini files are loaded in order, so settings from the plugin ini files will override the local or default settings (with the exception of blank settings, which will be ignored).\n\nThis lets you configure your release setup with a great deal of flexibility, while committing to your plugin directory the general settings required for anyone to perform the release.\n\nEach of the release.ini files have the following format:\n\n```\n[General]\nplugin-slug=\ntemp-dir=\nreadme-template=\nchangelog=\n\n[SVN]\nsvn-url=https://plugins.svn.wordpress.org/{{plugin-slug}}\nsvn-username=\nsvn-do-not-tag=\nsvn-path=\nsvn-tag-message=Tagged v{{tag}}.\nsvn-commit-message=Updates for v{{tag}} release.\n\n[GIT]\ngit-use-tag={{tag}}\ngit-path=\ngit-do-not-tag=true\ngit-tag-message=Tagged v{{tag}}.\n\n[Delete]\nDeleteFiles=\nDeleteDirs=\n```\n\n### General Settings\nThis section contains the following directives:\n\n* plugin-slug: The slug to use for this plugin, by default it is automatically generated from the directory name to which the GIT repo is checked out to.\n* temp-dir: The temporary directory to use, by default the system temp directory.\n* readme-template: The relative (to the plugin GIT repo) path/name of the readme.template file to use.\n* changelog: The relative (to the plugin GIT repo) path/name of the CHANGLOG.md to use.\n\n### SVN Settings\nThis section contains the following directives:\n\n* svn-url: The full URI of your plugin's SVN repo.\n* svn-username: The user name to use when committing changes to the SVN tree.\n* svn-do-not-tag: Disable tagging of the release in the SVN tree.\n* svn-path: Local path to the SVN utilities.\n* svn-tag-message: The commit message when tagging the release in the SVN tree.\n* svn-commit-message: The commit message when committing the changes to the trunk of the SVN tree.\n\n### GIT Settings\nThis section contains the following directives:\n\n* git-use-tag: The tag to use from the GIT repo, this can be a placeholder or a specific tag (like \"master\")\n* git-path: Local path the GIT utilities.\n* git-do-not-tag: By default the release script will check to see if the tag exists in the GIT repo and create it if it doesn't, setting this will instead abort the script if it is not found.\n* git-tag-message: The commit message when committing the changes to the trunk of the SVN tree.\n\n### Delete Settings\nThis section contains the following directives:\n\n* DeleteFiles: A comma separated list of files to delete.\n* DeleteDirs: A comma separated list of directories to delete\n\n## Configuration Examples\n\n### Standard Setup\n\nOk, so you've checked out the script and now you want to configure your plugin to use it, here's one way you might set it up:\n\n\t+---GIT to WP Plugin Dir Release Script\n\t|   |   CHANGES.md\n\t|   |   README.md\n\t|   |   release.ini\t\t\t\t\t\t\t[1]\n\t|   |   release.php\n\t|   |\n\t|   \\---Sample Templates\n\t|           CHANGES.md.sample\n\t|           readme.template.sample\n\t|           \n\t+---GP Additional Links\n\t|   |   CHANGES.md\n\t|   |   GlotPress-Logo-20px.png\n\t|   |   gp-additional-links.php\n\t|   |   README.md\n\t|   |   \n\t|   \\---bin\n\t|           readme.template\n\t|   \t\trelease.ini\t\t\t\t\t\t[3]\n\t|            \n\t+---release.ini\t\t\t\t\t\t\t\t[2]\n\nThe first [1] releaes.ini is the default one you checked out with the release script, no changes are needed here.\n\nThe second [2] is in the parent directory contains a release.ini script with the following lines:\n\n```\n[SVN]\nsvn-username=MyUserName\nsvn-path=C:\\Program Files\\TortoiseSVN\\bin\\\n```\n\nThese two lines let you set the path to the SVN utilities and what username you will be using for the SVN commits.\n\nThe third [3] ini is in your plugin repo and will contain something like:\n\n```\n[General]\nreadme-template=bin/readme.template\n\n[SVN]\nsvn-do-not-tag=\n\n[Delete]\nDeleteFiles=README.md, CHANGES.md\nDeleteDirs=bin\n```\n\nThis will set the plugin specific items you need.\n\n### Release to trunk instead of a tag\n\nYou may not want to use tags in the WordPress SVN repo (I don't' recommend this, but there are valid reasons not to), in which case you can still use this script.\n\nSetup your release.ini files in the same way as in the first example, with the following changes:\n\n* In your plugin repo [3] release.ini, add \"svn-do-not-tag=true\" to the [SVN] section.\n* Edit your readme template file and instead of using {{TAG}} for your \"Stable tag:\" line, replace it with the static \"trunk\" string.\n\n### Use a GIT branch instead of a tag\n\nDon't use relesae tags in your GIT repo?  No problem much like releaseing to trunk above you can use the release.ini in your repo [3] to use any branch/tag you wish to do the release.\n\nSetup your release.ini files in the same way as in the first example, with the following changes:\n\n* In your plugin repo [3] release.ini, add \"git-use-tag=master\" to the [GIT] section and replace \"master\" with the branch/tag you wish to use.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolstack%2Fgit-to-wp-plugin-dir-release-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoolstack%2Fgit-to-wp-plugin-dir-release-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolstack%2Fgit-to-wp-plugin-dir-release-script/lists"}