-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (65 loc) · 1.84 KB
/
deploy-for-wordpress.yml
File metadata and controls
65 lines (65 loc) · 1.84 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
name: Deploy for WordPress
on:
release:
types: [published]
jobs:
build:
name: Build release
runs-on: ubuntu-latest
env:
php: "8.2"
tools: composer
ini-values: default_charset='UTF-8'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php }}
ini-values: ${{ env.ini-values }}
coverage: pcov
tools: ${{ env.tools }}
env:
fail-fast: true
- name: Build
run: |
composer install -o --no-dev --ignore-platform-reqs
- name: Install WP-CLI
run: |
curl -sO https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
- name: Install dist-archive-command
run: |
wp package install wp-cli/dist-archive-command --allow-root
- name: Archive WordPress plugin
run: |
wp dist-archive . . --plugin-dirname=xrdebug --filename-format={name} --format=zip --allow-root
- name: Cache artifacts
uses: actions/cache/save@v4
with:
path: xrdebug.zip
key: ${{ runner.os }}-${{ github.sha }}
upload:
name: Upload release
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- build
steps:
- name: Restore artifacts
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
path: xrdebug.zip
key: ${{ runner.os }}-${{ github.sha }}
- name: Upload artifacts
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBodyDuringUpdate: true
artifacts: >
xrdebug.zip
token: ${{ secrets.GITHUB_TOKEN }}