-
Notifications
You must be signed in to change notification settings - Fork 190
75 lines (64 loc) · 2.49 KB
/
Copy pathdeploy.yml
File metadata and controls
75 lines (64 loc) · 2.49 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
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
name: Deploy
on:
release:
types: [published]
push:
branches:
# For readme and asset updates.
- master
# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}
jobs:
deploy:
name: Deploy to WordPress.org
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write # Required to upload assets to the GitHub release.
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Setup PHP and Composer
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: '7.4'
tools: composer:v2
- name: Install NPM dependencies
run: npm install
- name: Build plugin
run: npm run build
- name: WordPress.org asset and readme update
uses: 10up/action-wordpress-plugin-asset-update@2480306f6f693672726d08b5917ea114cb2825f7 # v2.2.0
# FIXME: The trunk branch doesn't exist so this does nothing on merges to the master branch.
if: github.ref_name == 'trunk'
env:
# Note: this action doesn't support BUILD_DIR so it pushes the raw readme.txt
IGNORE_OTHER_FILES: true
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
- name: WordPress.org deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # v2.3.0
if: startsWith( github.ref, 'refs/tags/' )
with:
generate-zip: true
# Skip deployments of pre-releases to WordPress.org since the deploy step would update trunk readme stable version.
dry-run: ${{ true == github.event.release.prerelease }}
env:
BUILD_DIR: dist
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
- name: Upload release asset
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
if: startsWith( github.ref, 'refs/tags/' )
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ steps.deploy.outputs.zip-path }}
fail_on_unmatched_files: true