This article will surely speak toPlugin WordPress developers who post to the WordPress repository... and those who don't post to the WordPress repository so that they don't have to use SVN.
Indeed SVN is in a way the ancestor of GIT and nowadays rare are the developers who have not switched to Git.
Github is a service hosting GIT repositories that devs are particularly fond of and very much used in the Open-Source world.
A few weeks ago, GitHub released the Github shares.
OK mais qu’est ce que c’est Github actions?
In simple, it is a solution to automate tasks when an action occurs on a deposit or a branch of a deposit (pull / push ...)
That's where it gets interesting!
Previously, for my personal example, I would version my code on Github and then transfer my PluginWordPress files by hand to the WordPress.org SVN.
It works... but
it's long and boring!
10Up est l’une des grosses agence WordPress dans le monde et ils viennent de publier une action permettant de publier sur le repo WordPress lorsque l’on push sur une branche d’un repo Git, un Tag particulier.
Ce tag sera repris sur le dépot WordPress afin de publier la nouvelle version de votre travail.
How do we do it?
I don't know if it's the way to do it the right way as they say... but it's the way I use it... it will surely improve with time, experience, cough cough cough.
In my project, I create a folder
.github note the dot in front and then a subfolder
Create a file named `main.yml` in the latter directory:
Commit, then push this file.
Go to your Github repository, in the "Actions" tab you should find the action created earlier.
We used a variable
SVN_PASSWORD and a
SVN_USERNAME corresponding to the SVN IDs needed to publish on the WordPress repo. We'll need to get them to Github so he can connect securely.
Go to the tab "Settings".
Click on "Add a new secret"
In the "Name" input, enter the first variable name, i.e. " "...".
SVN_PASSWORD" and enter the password of your wp.org account in the textarea "Value".
Repeat, adapting for the variable corresponding to your password.
If all went well, the next time you create and push a Git tag, your Pluginwill automatically be published to the Official WordPress repository.
Image à la Une : Kid Circus
Don't miss any of my articles, subscribe to my newsletter
(1 mail per month if there is new content)