-
Notifications
You must be signed in to change notification settings - Fork 368
52 lines (50 loc) · 1.94 KB
/
create-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
name: Create Plugin Release
on:
pull_request:
types:
- closed
branches:
- 'trunk'
jobs:
deploy:
if: github.event.pull_request.merged == true && startsWith( github.head_ref, 'release/' )
runs-on: ubuntu-latest
name: WPJM Release
steps:
- uses: actions/checkout@v4
- name: Comment on PR
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh pr comment ${{ github.event.number }} --body "🚀 **[Release workflow started](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})**"
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none
- name: Install JS dependencies
run: npm ci
- name: Install PHP dependencies
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress
- name: Setup Git
run: |
git config user.name "WPJM Bot"
git config user.email "<[email protected]>"
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
node scripts/create-release.mjs wp-job-manager ${{ github.event.number }}
cd build && unzip -q wp-job-manager.zip
- name: Deploy to WordPress.org
uses: 10up/action-wordpress-plugin-deploy@abb939a0d0bfd01063e8d1933833209201557381
env:
SVN_PASSWORD: ${{ secrets.WORDPRESSORG_SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.WORDPRESSORG_SVN_USERNAME }}
BUILD_DIR: build/wp-job-manager
SLUG: wp-job-manager
VERSION: ${{ steps.create_release.outputs.version }}
- name: Comment on PR
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh pr comment ${{ github.event.number }} --body "✅ Release **${{ steps.create_release.outputs.version }}** [deployed to WordPress.org](https://wordpress.org/plugins/wp-job-manager/)."