-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters