generated from jrtashjian/pluginwp
-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (41 loc) · 1.44 KB
/
build-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
name: Build release zip
on:
workflow_run:
workflows: [Static Analysis]
types: [completed]
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- name: Restore npm dependency cache
uses: ./.github/actions/restore-npm-cache
- name: Build scripts
run: npm run build
- name: Install PHP-Scoper
run: composer global require humbug/php-scoper
- name: Install WP CLI
run: |
composer global require wp-cli/wp-cli-bundle
composer global require wp-cli/dist-archive-command
- name: Add Composer bin to PATH
run: echo "$HOME/.composer/vendor/bin/" >> $GITHUB_PATH
- name: Install composer dependencies
run: composer run phpscoper
- name: Generate zip
run: wp dist-archive ./ ${{ github.event.repository.name }}
- name: Unzip the archive (prevents double zip problem)
run: unzip ${{ github.event.repository.name }}.zip -d zipfile
shell: bash
- name: Upload the archive as an artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: zipfile
retention-days: 5
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'