-
Notifications
You must be signed in to change notification settings - Fork 368
54 lines (52 loc) · 1.95 KB
/
build.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: Plugin Build
on:
- pull_request
jobs:
build:
name: Plugin Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install JS dependencies
run: npm ci
- name: Install PHP dependencies
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress
- name: Build Plugin
run: npm run build
- name: Decompress plugin
run: unzip build/wp-job-manager.zip -d wp-job-manager
- name: Store Artifact
uses: actions/upload-artifact@v2
with:
name: wp-job-manager-${{ github.event.pull_request.head.sha }}
path: ${{ github.workspace }}/wp-job-manager/
retention-days: 7
- name: Save plugin zip and add link to the PR description
env:
WPJMCOM_API_LOGIN: ${{ secrets.WPJMCOM_API_LOGIN }}
GH_TOKEN: ${{ github.token }}
run: node scripts/upload-and-link-plugin-zip.mjs --pr ${{ github.event.number }} --commit ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.merged && '--merged' || '' }}