Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
awps committed Mar 13, 2022
1 parent 76c9d6f commit 5719135
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
push:
tags:
- "*.*.*"
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Deploy
run: chmod +x ./deploy.sh && ./deploy.sh
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
23 changes: 17 additions & 6 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
#!/usr/bin/env bash
# https://zerowp.com/?p=55

# Get the plugin slug from this git repository.
PLUGIN_SLUG="${PWD##*/}"

sed -i -e "s/__STABLE_TAG__/$TRAVIS_TAG/g" ./src/readme.txt
sed -i -e "s/__STABLE_TAG__/$TRAVIS_TAG/g" ./src/plugin-base.php
# Get the current release version
TAG=$(sed -e "s/refs\/tags\///g" <<< $GITHUB_REF)

# Get the SVN data from wp.org in a folder named `svn`
svn co --depth immediates "https://plugins.svn.wordpress.org/$PLUGIN_SLUG" ./svn

svn update --set-depth infinity ./svn/trunk
svn update --set-depth infinity ./svn/assets
svn update --set-depth infinity ./svn/tags/$TRAVIS_TAG
svn update --set-depth infinity ./svn/tags/$TAG

# Copy files from `src` to `svn/trunk`
cp -R ./src/* ./svn/trunk

# Copy the images from `assets` to `svn/assets`
cp -R ./wp_org/assets/* ./svn/assets

# 3. Switch to SVN repository
# 3. Switch to SVN directory
cd ./svn

# Prepare the files for commit in SVN
svn add --force trunk
svn add --force assets

svn cp trunk tags/$TRAVIS_TAG
# Create the version tag in svn
svn cp trunk tags/$TAG

# Prepare the tag for commit
svn add --force tags

svn ci --message "Release $TRAVIS_TAG" \
# Commit files to wordpress.org.
svn ci --message "Release $TAG" \
--username $SVN_USERNAME \
--password $SVN_PASSWORD \
--non-interactive
3 changes: 3 additions & 0 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Icon attribution: http://www.flaticon.com/free-icon/robot_189740

== Changelog ==

= 1.8.0 =
* Update PHP versions, DB explorer, remove Testing and JSON parser

= 1.7.2 =
* Replace `SCRIPTS_DEBUG` with `SCRIPT_DEBUG` in the main page report
* WP Compatibility Update
Expand Down

0 comments on commit 5719135

Please sign in to comment.