-
Notifications
You must be signed in to change notification settings - Fork 12
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
1 parent
eaa21e4
commit 61df4cf
Showing
3 changed files
with
16 additions
and
52 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
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,55 +1,20 @@ | ||
name: Deploy to WordPress SVN | ||
|
||
name: Deploy to WordPress.org | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
- "*" | ||
jobs: | ||
deploy: | ||
tag: | ||
name: New tag | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
# Step 2: Set up Node.js (use the latest stable version) | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' # Use latest LTS version of Node.js | ||
|
||
# Step 3: Install Node.js dependencies (if you have any, can be skipped if not needed) | ||
# - name: Install dependencies | ||
# run: npm install | ||
|
||
# Step 4: Generate readme.txt using the Node.js script in .github/scripts/ | ||
- name: Generate readme.txt | ||
run: node .github/scripts/generate-readme.js | ||
|
||
# Step 5: Install Subversion | ||
- name: Install Subversion | ||
run: sudo apt-get install subversion | ||
|
||
# Step 6: Deploy to WordPress SVN /trunk/ | ||
- name: Deploy to WordPress SVN /trunk/ | ||
env: | ||
SVN_USERNAME: ${{ secrets.WORDPRESS_USERNAME }} | ||
SVN_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }} | ||
run: | | ||
svn co https://plugins.svn.wordpress.org/discontinued-products/ svn-dir | ||
rsync -av --delete --exclude=".git" ./ svn-dir/trunk/ | ||
cp .github/temp/readme.txt svn-dir/trunk/readme.txt # Copy the newly generated readme.txt | ||
cd svn-dir | ||
svn add --force trunk/* | ||
svn commit -m "Deploying version ${{ github.ref }}" --username $SVN_USERNAME --password $SVN_PASSWORD --non-interactive | ||
# Step 7: Create a tag in WordPress SVN /tags/ | ||
- name: Create SVN Tag | ||
env: | ||
SVN_USERNAME: ${{ secrets.WORDPRESS_USERNAME }} | ||
SVN_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }} | ||
run: | | ||
VERSION=${GITHUB_REF/refs\/tags\/v/} | ||
svn cp https://plugins.svn.wordpress.org/discontinued-products/trunk https://plugins.svn.wordpress.org/discontinued-products/tags/$VERSION -m "Tagging version $VERSION" --username $SVN_USERNAME --password $SVN_PASSWORD --non-interactive | ||
- uses: actions/checkout@master | ||
- name: Generate readme.txt | ||
run: node .github/scripts/generate-readme.js | ||
- name: WordPress Plugin Deploy | ||
uses: 10up/action-wordpress-plugin-deploy@stable | ||
env: | ||
SVN_PASSWORD: ${{ secrets.WORDPRESS_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.WORDPRESS_USERNAME }} | ||
SLUG: discontinued-products | ||
|
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