-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (78 loc) · 2.43 KB
/
deploy.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Deploy to WordPress.org Repository
on:
release:
types: [released]
jobs:
deploy_to_wp_repository:
name: Deploy to WP.org
runs-on: ubuntu-latest
env:
PLUGIN_SLUG: bit-smtp
DRY_RUN: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install frontend dependencies
run: pnpm install
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: '7.x'
tools: composer:v2, wp-cli
- name: Get Composer cache directory
id: composer-cache
shell: bash
run: |
echo "COMPOSER_CACHE_PATH=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup composer cache
with:
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_PATH }}
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-cache-
- name: Install php dependencies
run: composer i --no-dev --optimize-autoloader
- name: Build
id: build-plugin
run: |
pnpm build
pnpm i18n:parse-js
pnpm i18n:php
- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
dry-run: ${{ env.DRY_RUN }}
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: ${{ env.PLUGIN_SLUG }}
- name: Upload release asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ steps.deploy.outputs['zip-path'] }}