Skip to content
Snippets Groups Projects
Erick Hitter's avatar
Erick Hitter authored
Add CI badge

See merge request !1
52c417c4
Name Last commit Last update
scripts
.gitignore
.gitlab-ci.yml
LICENSE
README.md

WP.org Plugin Deploy pipeline status

Deploy plugin updates to WordPress.org's plugin SVN. Modeled on 10up's GitHub action of the same intent.

Configuration

  1. Add the .gitlab-ci.yml configuration described below.
  2. Set the environment variables in the GitLab project.

.gitlab-ci.yml

Add the following to the plugin's .gitlab-ci.yml:

PluginSVN:
  stage: deploy
  image: containers.ethitter.com:443/docker/images/php:7.3
  before_script:
    - apt-get update
    - apt-get install -y rsync
    - curl -o ./bin/deploy.sh https://git-cdn.e15r.co/open-source/wp-org-plugin-deploy/raw/master/scripts/deploy.sh
    - chmod +x ./bin/deploy.sh
  script: ./bin/deploy.sh
  when: on_success

While unnecessary, if you'd rather save the time of testing the deploy, append the following to the CI job's configuration:

only:
  - master

The above is a time-save only; the build script exits before the svn commit stage if the merge isn't into master.

CI Environment Variables

Set the following environment variables in the GitLab project's configuration:

  • WP_ORG_PASSWORD
  • WP_ORG_PASSWORD
  • PLUGIN_SLUG - plugin's name on WordPress.org
  • PLUGIN_VERSION - version to tag
  • WP_ORG_RELEASE_REF - commit ref (branch or tag) to use for release

Alternatives

A loader script is available as an alternative to downloading the deploy script during the before_script stage.