Repository navigation
39 lines (39 loc) · 1.5 KB
/
Copy pathdeploy.yml
File metadata and controls
39 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Deploy to WordPress.org
on:
release:
types: [published]
jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check release tag matches plugin version
run: |
tag="${GITHUB_REF_NAME#v}"
header=$(sed -n 's/^Version: *//p' paystack.php | tr -d '\r ')
constant=$(sed -n "s/^define('GF_PAYSTACK_VERSION', '\(.*\)');.*/\1/p" paystack.php | tr -d '\r')
stable=$(sed -n 's/^Stable tag: *//p' readme.txt | tr -d '\r ')
if [ "$tag" != "$header" ] || [ "$tag" != "$constant" ] || [ "$tag" != "$stable" ]; then
echo "::error::Release tag $tag does not match Version $header / GF_PAYSTACK_VERSION $constant / Stable tag $stable"
exit 1
fi
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: paystack-add-on-for-gravity-forms
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip