-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 1.97 KB
/
release.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: 🚀 Release to WordPress.org plugins repo
on:
release:
types: [published, edited]
jobs:
tag:
name: 🎉 New Release
runs-on: ubuntu-latest
env:
PUSH_TO_SVN: 'no'
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer, wp-cli
- name: Install Composer dependencies in build
run: composer install --no-dev --no-interaction
- name: Dump autoload
run: composer dump-autoload --classmap-authoritative -o
- name: Install WP-CLI dist-archive
run: wp package install wp-cli/dist-archive-command
- name: Create ZIP file
run: wp dist-archive . ./${{ github.event.release.name }}.zip --plugin-dirname=product-specifications
- 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: "./${{ github.event.release.name }}.zip"
asset_name: ${{ github.event.release.name }}.zip
asset_content_type: application/zip
- name: Check release type
run: |
if [[ "${{github.event.release.tag_name}}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "PUSH_TO_SVN=yes" >> $GITHUB_ENV
fi
- name: 🚀 WordPress Plugin Deploy
id: deploy
if: ${{env.PUSH_TO_SVN == 'yes'}}
uses: 10up/action-wordpress-plugin-deploy@master
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
- name: 🚀 WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@master
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: email-verification-on-signups